ApiSettingsSchema: CommonSettingSchema & {
    assets?: AssetsConfig;
    http2?: boolean;
    httpServerTimeout?: number;
    internalServiceSpecialChar?: string | RegExp;
    ip?: string;
    log4XXResponses?: boolean;
    logRequest?: LogLevels | null;
    logRequestParams?: LogLevels | null;
    logResponse?: LogLevels | null;
    logResponseData?: LogLevels | null;
    logRouteRegistration?: LogLevels | null;
    optimizeOrder?: boolean;
    path?: string;
    port?: number;
    qsOptions?: IParseOptions;
    rootCallOptions?: CallingOptions;
    routes?: MoleculerWebTypes.ApiRouteSchema[];
    server?: boolean;
    [k: string]: any;
}

Type declaration

  • [k: string]: any

    for extra setting's keys

  • Optional assets?: AssetsConfig

    It serves assets with the serve-static module like ExpressJS.

  • Optional http2?: boolean

    Use HTTP2 server (experimental)

    Default

    false
    
  • Optional httpServerTimeout?: number

    HTTP Server Timeout

    Default

    null
    
  • Optional internalServiceSpecialChar?: string | RegExp

    Special char for internal services
    Note: RegExp type is not official

    Default

    "~"
    

    Example

    "~" => /~node/~action => /$node/~action
    

    Example

    /[0-9]+/g => /01234demo/hello2021 => /demo/hello `(not official)`
    
  • Optional ip?: string

    Exposed IP

    Default

    process.env.IP || "0.0.0.0"
    
  • Optional log4XXResponses?: boolean

    If set to true, it will log 4xx client errors, as well

    Default

    false
    
  • Optional logRequest?: LogLevels | null

    Log each request (default to "info" level)

    Default

    "info"
    
  • Optional logRequestParams?: LogLevels | null

    Log the request ctx.params (default to "debug" level)

    Default

    "debug"
    
  • Optional logResponse?: LogLevels | null

    Log each response (default to "info" level)

    Default

    "info"
    
  • Optional logResponseData?: LogLevels | null

    Log the response data (default to disable)

    Default

    null
    
  • Optional logRouteRegistration?: LogLevels | null

    Log the route registration/aliases related activity

    Default

    "info"
    
  • Optional optimizeOrder?: boolean

    Optimize route order

    Default

    true
    
  • Optional path?: string

    Global path prefix

  • Optional port?: number

    Exposed port

    Default

    process.env.PORT || 3000
    
  • Optional qsOptions?: IParseOptions

    Options passed on to qs

  • Optional rootCallOptions?: CallingOptions

    CallOption for the root action api.rest

    Default

    null
    
  • Optional routes?: MoleculerWebTypes.ApiRouteSchema[]

    Gateway routes

    Default

    []
    
  • Optional server?: boolean

    Used server instance. If null, it will create a new HTTP(s)(2) server
    If false, it will start without server in middleware mode

    Default

    true