createTRPCRequestHandler()
Create a RequestHandler for SvelteKit +server.ts, e.g. GET, POST, etc.
Example file location: src/routes/api/trpc/[...trpc]/+server.ts
If endpoint isn't specified, it will be inferred from the pathname.
e.g. if pathname is '/api/trpc/,a,b,c', where '/a,b,c' are params, the endpoint should be calculated as '/api/trpc'
Signature
createTRPCRequestHandler<TRouter, TRouteParams, TRouteId>(options: TRPCHandleOptions<TRouter, TRouteParams, TRouteId>): RequestHandler<TRouteParams, TRouteId>;
Type parameters
TRouterextendsRouter<AnyRouterDef<AnyRootConfig,any>,TRouter>TRouteParamsextendsPartial<Record<string,string>> =Partial<Record<string,string>>TRouteIdextendsnull|string=null|string
Parameters
| Name | Type |
|---|---|
options | TRPCHandleOptions<TRouter, TRouteParams, TRouteId> |
Returns
RequestHandler<TRouteParams, TRouteId>
Defined in: requestHandler.ts:13