Interface: HttpConfig
Interface: HttpConfig
Represents the core HTTP config options for the application. HTTP configuration options that are commonly used across adapters.
Properties
body
body: object;
Configuration for request body parsing.
defaultCharset
defaultCharset: string;
The default character set for the request body.
defaultType
defaultType: string;
The content type of the request body.
limit
limit: string;
The maximum size of the request body.
cache
cache: Record<string, any>;
Cache configuration options.
cookie
cookie: object;
Cookie-related configuration options.
options
options: CookieOptions;
Additional cookie options.
secret
secret: string;
The secret used for signing cookies.
cors
cors: HttpCorsConfig;
Cross-Origin Resource Sharing (CORS) configuration options.
etag
etag: object;
ETag-related configuration options.
function()?
optional function: (content, encoding) => string;
A custom function for generating ETags.
Parameters
content
string
encoding
Encoding
Returns
string
files
files: object;
File upload and response configuration options.
defaultCompressionEncoding
defaultCompressionEncoding: Record<string, string>;
The default encoding for compressed static files.
download
download: Record<string, any>;
Configuration for file responses.
extensions?
optional extensions: string[];
The list of accepted file extensions.
rootDir?
optional rootDir: string;
The root directory for serving static files.
upload
upload: Record<string, any>;
Configuration for file uploads.
hosts
hosts: object;
Host-related configuration options.
onlySubdomain
onlySubdomain: boolean;
Whether only subdomains are allowed.
trusted
trusted: string[];
A list of trusted hostnames.
trustedPattern
trustedPattern: string[];
A list of trusted host patterns.
json
json: HttpJsonConfig;
JSON-related configuration options.
jsonp
jsonp: object;
JSONP-related configuration options.
callback
callback: object;
Configuration for the JSONP callback function.
callback.name
name: string;
The name of the JSONP callback parameter.
proxies
proxies: object;
Proxy-related configuration options.
trustedIp
trustedIp: string[];
A list of trusted proxies.
untrustedIp
untrustedIp: string[];
A list of untrusted proxies.
subdomain
subdomain: object;
Subdomain-related configuration options.
offset
offset: number;
The offset to use when determining subdomains.