Optional
assetsIt serves assets with the serve-static module like ExpressJS.
Optional
corsCross-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
}
Optional
etagThe etag option value can be false
, true
, weak
, strong
, or a custom Function
Optional
http2Use HTTP2 server (experimental)
Optional
httpHTTP Server Timeout
Optional
internalSpecial char for internal services
Note: RegExp
type is not official
Optional
ipExposed IP
Optional
log4XXResponsesIf set to true, it will log 4xx client errors, as well
Optional
logLog each request (default to "info" level)
Optional
logLog the request ctx.params (default to "debug" level)
Optional
logLog each response (default to "info" level)
Optional
logLog the response data (default to disable)
Optional
logLog the route registration/aliases related activity
Optional
onYou can add route-level & global-level custom error handlers.
In handlers, you must call the res.end
. Otherwise, the request is unhandled.
Optional
openapiOptional
optimizeOptimize route order
Optional
pathGlobal path prefix
Optional
portExposed port
Optional
qsOptions passed on to qs
Optional
rateThe Moleculer-Web has a built-in rate limiter with a memory store.
Optional
rootCallOption for the root action api.rest
Optional
routesGateway routes
Optional
serverUsed server instance. If null, it will create a new HTTP(s)(2) server
If false, it will start without server in middleware mode
Optional
useIt 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
for extra setting's keys