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

    Type Alias CommonSettingSchema

    type CommonSettingSchema = {
        cors?: CorsOptions;
        etag?: boolean | "weak" | "strong" | ETagFunction;
        onError?: (req: IncomingMessage, res: ServerResponse, error: Error) => void;
        rateLimit?: unknown;
        use?: (routeMiddleware | routeMiddlewareError)[];
    }
    Index

    Properties

    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

    onError?: (req: IncomingMessage, 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.

    rateLimit?: unknown

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

    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