@spailybot/moleculer-auto-openapi - v1.3.2
    Preparing search index...

    Interface ApiSettingsSchemaOpenApi

    interface ApiSettingsSchemaOpenApi {
        assets?: AssetsConfig;
        cors?: CorsOptions;
        etag?: boolean | "weak" | "strong" | ETagFunction;
        http2?: boolean;
        httpServerTimeout?: number;
        internalServiceSpecialChar?: string | RegExp;
        ip?: string;
        log4XXResponses?: boolean;
        logRequest?: null | LogLevels;
        logRequestParams?: null | LogLevels;
        logResponse?: null | LogLevels;
        logResponseData?: null | LogLevels;
        logRouteRegistration?: null | LogLevels;
        onError?: (req: IncomingRequest, res: ServerResponse, error: Error) => void;
        openapi?: ApiSettingsOpenApi;
        optimizeOrder?: boolean;
        path?: string;
        port?: number;
        qsOptions?: IParseOptions;
        rateLimit?: RateLimitSettings;
        rootCallOptions?: CallingOptions;
        routes?: ApiRouteSchema[];
        server?: APISettingServer;
        use?: (routeMiddleware | routeMiddlewareError)[];
        [k: string]: any;
    }

    Hierarchy

    • ApiSettingsSchema
      • ApiSettingsSchemaOpenApi

    Indexable

    • [k: string]: any

      for extra setting's keys

    Index

    Properties

    assets?: AssetsConfig

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

    cors?: CorsOptions

    Cross-origin resource sharing configuration (using module cors)

    {
    // Configures the Access-Control-Allow-Origin CORS header.
    origin: "*", // ["http://localhost:3000", "https://localhost:4000"],
    // Configures the Access-Control-Allow-Methods CORS header.
    methods: ["GET", "OPTIONS", "POST", "PUT", "DELETE"],
    // Configures the Access-Control-Allow-Headers CORS header.
    allowedHeaders: [],
    // Configures the Access-Control-Expose-Headers CORS header.
    exposedHeaders: [],
    // Configures the Access-Control-Allow-Credentials CORS header.
    credentials: false,
    // Configures the Access-Control-Max-Age CORS header.
    maxAge: 3600
    }
    etag?: boolean | "weak" | "strong" | ETagFunction

    The etag option value can be false, true, weak, strong, or a custom Function

    http2?: boolean

    Use HTTP2 server (experimental)

    false
    
    httpServerTimeout?: number

    HTTP Server Timeout

    null
    
    internalServiceSpecialChar?: string | RegExp

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

    "~"
    
    "~" => /~node/~action => /$node/~action
    
    /[0-9]+/g => /01234demo/hello2021 => /demo/hello `(not official)`
    
    ip?: string

    Exposed IP

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

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

    false
    
    logRequest?: null | LogLevels

    Log each request (default to "info" level)

    "info"
    
    logRequestParams?: null | LogLevels

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

    "debug"
    
    logResponse?: null | LogLevels

    Log each response (default to "info" level)

    "info"
    
    logResponseData?: null | LogLevels

    Log the response data (default to disable)

    null
    
    logRouteRegistration?: null | LogLevels

    Log the route registration/aliases related activity

    "info"
    
    onError?: (req: IncomingRequest, res: ServerResponse, error: Error) => void

    You can add route-level & global-level custom error handlers.
    In handlers, you must call the res.end. Otherwise, the request is unhandled.

    optimizeOrder?: boolean

    Optimize route order

    true
    
    path?: string

    Global path prefix

    port?: number

    Exposed port

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

    Options passed on to qs

    rateLimit?: RateLimitSettings

    The Moleculer-Web has a built-in rate limiter with a memory store.

    rootCallOptions?: CallingOptions

    CallOption for the root action api.rest

    null
    
    routes?: ApiRouteSchema[]

    Gateway routes

    []
    
    server?: APISettingServer

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

    true
    
    use?: (routeMiddleware | routeMiddlewareError)[]

    It supports Connect-like middlewares in global-level, route-level & alias-level.
    Signature: function (req, res, next) {...}.
    Signature: function (err, req, res, next) {...}.
    For more info check express middleware