Optionalcors{
// 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
}
OptionaletagThe etag option value can be false, true, weak, strong, or a custom Function
OptionalonYou can add route-level & global-level custom error handlers.
In handlers, you must call the res.end. Otherwise, the request is unhandled.
OptionalrateThe Moleculer-Web has a built-in rate limiter with a memory store.
OptionaluseIt 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
Cross-origin resource sharing configuration (using module cors)