Type Alias: NodeHTTPHandlerOptions<TRouter, TRequest, TResponse>
NodeHTTPHandlerOptions<
TRouter,TRequest,TResponse>:HTTPBaseHandlerOptions<TRouter,TRequest> &NodeHTTPCreateContextOption<TRouter,TRequest,TResponse> &object
Defined in: packages/server/src/adapters/node-http/types.ts:81
Type declaration
maxBodySize?
optionalmaxBodySize:number
middleware?
optionalmiddleware:ConnectMiddleware<TRequest,TResponse>
By default, http OPTIONS requests are not handled, and CORS headers are not returned.
This can be used to handle them manually or via the cors npm package: https://www.npmjs.com/package/cors
tsimport cors from 'cors'nodeHTTPRequestHandler({middleware: cors()})
tsimport cors from 'cors'nodeHTTPRequestHandler({middleware: cors()})
You can also use it for other needs which a connect/node.js compatible middleware can solve, though you might wish to consider an alternative solution like the Express adapter if your needs are complex.
Type Parameters
| Type Parameter |
|---|
TRouter extends AnyTRPCRouter |
TRequest extends NodeHTTPRequest |
TResponse extends NodeHTTPResponse |