OptionaltrustProxy?: string | boolean | ((address: string, distance: number) => boolean)OptionalsubdomainOffset?: numberURL segments to ignore when extracting subdomains from a URL. Defaults to 2
OptionalgenerateRequestId?: booleanEnabling the flag will generated a unique request id from every HTTP request.
The request id can be accessed using the "request.id()" method. Also,
the value of x-request-id header is used as the id (if it exists).
Defaults to false
OptionalcreateRequestId?: {}OptionalallowMethodSpoofing?: booleanMethod spoofing allows changing the request method using the query string. For example: Making a POST request on URL /users/1?_method=PATCH will be handled by the patch route.
Defaults to false
OptionalgetIp?: (request: any) => stringA custom implementation to get the request ip address
Optionaletag?: booleanWhether or not to generate etags for responses. Etags can be enabled/disabled when sending response as well.
Defaults to false
OptionaljsonpCallbackName?: stringThe callback name for the JSONP response.
Defaults to 'callback'
Optionalcookie?: {Default options to apply when setting cookies
Optionaldomain?: stringDomain name for the cookie
Optionalexpires?: Date | (() => Date)Expiration date for the cookie or function that returns the date
OptionalhttpOnly?: booleanWhether the cookie should be accessible only through HTTP(S)
OptionalmaxAge?: string | numberMaximum age of the cookie in seconds or as a string
Optionalpath?: stringURL path for which the cookie is valid
OptionalsameSite?: boolean | "lax" | "none" | "strict"SameSite attribute to control cross-site request behavior
Optionalsecure?: booleanWhether the cookie should only be sent over HTTPS
Optionalpartitioned?: booleanWhether the cookie should be partitioned (optional)
Optionalpriority?: "low" | "medium" | "high"Priority level for the cookie (optional)
OptionaluseAsyncLocalStorage?: booleanWhether or not to create an async local storage store for the HTTP context.
Defaults to false
Optionalqs?: {Config for query string parser
Optionalparse?: {Configuration options for parsing query strings
Optionaldepth?: numberNesting depth till the parameters should be parsed.
Defaults to 5
OptionalparameterLimit?: numberNumber of parameters to parse.
Defaults to 1000
OptionalallowSparse?: booleanAllow sparse elements in an array.
Defaults to false
OptionalarrayLimit?: numberThe max limimit for the array indices. After the given limit the array indices will be converted to an object, where the index is the key.
Defaults to 20
Optionalcomma?: booleanJoin comma seperated query string values to an array
Defaults to false
Optionalstringify?: {Configuration options for stringifying query objects
Optionalencode?: booleanURI encode the stringified query string
Defaults to true
OptionalencodeValuesOnly?: booleanURI encode but only the values and not the keys
Defaults to false
OptionalarrayFormat?: "indices" | "brackets" | "repeat" | "comma"Define the format in which arrays should be serialized.
Defaults to "indices"
OptionalskipNulls?: booleanWhether or not to skip null values when serializing. When set to false, the null values will be treated as an empty string.
Defaults to: false
OptionalkeepAliveTimeout?: numberThe number of milliseconds of inactivity a server needs to wait for additional incoming data after it has finished writing the last response.
OptionalheadersTimeout?: numberLimit the amount of time the parser will wait to receive the complete HTTP headers.
OptionalrequestTimeout?: numberSets the timeout value in milliseconds for receiving the entire request from the client
Optionaltimeout?: numberThe number of milliseconds of inactivity before a socket is presumed to have timed out
Define configuration for the HTTP server