@gibme/webserver
    Preparing search index...

    Type Alias Options

    type Options = {
        autoContentSecurityPolicyHeaders: boolean | CSPDirectives;
        autoHandle404: boolean;
        autoHandleOptions: boolean;
        autoParseJSON: boolean;
        autoParseRaw: boolean;
        autoParseText: boolean;
        autoParseURLEncoded: boolean;
        autoParseXML: boolean;
        autoRecommendedHeaders: boolean;
        autoStartCloudflared: boolean;
        backlog: number;
        bodyLimit: number;
        compression: boolean;
        cookieSecret: CipherKey | CipherKey[];
        corsOrigin: string | CorsOptions;
        errorSink?: ErrorSink;
        helmet: HelmetOptions | boolean;
        host: string;
        logging: boolean | "full" | ((entry: LogEntry) => Promise<void> | void);
        port: number;
        sessions: expressSession.SessionOptions | boolean;
        ssl: false | { certificate: string | Buffer; privateKey: string | Buffer };
        suppressProcessErrors: boolean;
        wsAuth?: AuthenticationProvider;
        wsAuthTimeoutMs?: number;
        wsOptions: WebSocket.ServerOptions;
        xml: {
            parserOptions?: XMLParserOptions;
            validatorOptions?: XMLValidatorOptions;
        };
    }
    Index

    Properties

    autoContentSecurityPolicyHeaders: boolean | CSPDirectives

    Whether we enable the content security policy header by default. Set to an object of directives (e.g. { 'default-src': "'self'", 'img-src': ['*'] }) to override the default default-src 'self' policy.

    false
    
    autoHandle404: boolean

    Whether we should auto handle 404s

    true
    
    autoHandleOptions: boolean

    Whether we should auto handle options

    true
    
    autoParseJSON: boolean

    Whether we will automatically parse JSON request bodies

    true
    
    autoParseRaw: boolean

    Whether we will automatically parse RAW request bodies

    true
    
    autoParseText: boolean

    Whether we will automatically parse Text request bodies

    true
    
    autoParseURLEncoded: boolean

    Whether we will automatically parse URLEncoded request bodies

    true
    
    autoParseXML: boolean

    Whether we will automatically parse XML request bodies

    true
    
    autoRecommendedHeaders: boolean

    Whether we should return the default list of recommended headers with every request

    true
    
    autoStartCloudflared: boolean

    Whether to automatically start cloudflared tunnel

    false
    
    backlog: number

    TCP backlog for the underlying server

    511
    
    bodyLimit: number

    Body size limit in MB

    2
    
    compression: boolean

    Whether compression should be enabled by default

    true
    
    cookieSecret: CipherKey | CipherKey[]

    Secret(s) used for cookie signing

    corsOrigin: string | CorsOptions

    The CORS origin to allow. Accepts either a single string (legacy form) or a full options bag (origin/methods/allowedHeaders/exposedHeaders/ credentials/maxAge/preflightContinue/optionsSuccessStatus). When credentials: true, the wildcard origin * is reflected to the request's Origin header instead of being emitted literally.

    '*'
    
    errorSink?: ErrorSink

    Optional sink invoked when the library would otherwise silently swallow an internal error (e.g. an unparseable Authorization header, a malformed JSON cookie, or a throwing logging callback). The sink receives the error and a stable string context. Thrown sink errors are caught and discarded.

    undefined (silent)
    
    helmet: HelmetOptions | boolean

    Helmet module options

    false
    
    host: string

    The host address to bind to

    0.0.0.0 (all)
    
    logging: boolean | "full" | ((entry: LogEntry) => Promise<void> | void)

    Defines how request logging is handled.

    For true: High level information of each Request will be logged as debug to the console/file For full: Headers and the Request body (if POST/PATCH/PUT) are also provided in the log entry For callback: Full log entries are provided to the specified callback method, and the entry will not be passed to the standard logging facility.

    false
    
    port: number

    The bind port for the server

    443 if ssl, 80 if non-ssl
    
    sessions: expressSession.SessionOptions | boolean

    Whether we enable session support

    Note: At a minimum, a secret must be supplied if options are specified

    false
    
    ssl: false | { certificate: string | Buffer; privateKey: string | Buffer }

    Whether SSL should be enabled

    Type Declaration

    • false
    • { certificate: string | Buffer; privateKey: string | Buffer }
      • certificate: string | Buffer

        The SSL certificate file and/or data.

        Note: If a string is specified, a full path is expected

      • privateKey: string | Buffer

        The SSL private key file and/or data

        Note: If a string is specified, a full path is expected

    false
    
    suppressProcessErrors: boolean

    If set to true, allows node to crash via thrown exceptions If set to false (or unset), thrown exceptions are swallowed and logged automatically

    true
    

    Authentication provider applied to every WebSocket route that does not specify its own. Per-route auth (via app.ws(route, auth, handler) or ProtectedRouter().ws(...)) overrides this fallback.

    undefined (no app-level WebSocket gate)
    
    wsAuthTimeoutMs?: number

    Maximum time in milliseconds an AuthenticationProvider is allowed to take during a WebSocket handshake before the upgrade is denied with HTTP 504. Set to 0 to disable. Prevents a hung provider from holding sockets open indefinitely.

    30000
    
    wsOptions: WebSocket.ServerOptions

    WebSocket server options

    xml: {
        parserOptions?: XMLParserOptions;
        validatorOptions?: XMLValidatorOptions;
    }

    Automatic XML body parser handling options