Module: config

The configuration parameters module of the webserver adapter.

The property values of this object will be resolved during the startup process.
This object will appear as the default setup within the container.config.webServer property during the startup process, when the startup function of this adapter is called.

In order to change the values of the configuration parameters, use either the corresponding environment variables, or merge your config object, with this default config setup.

Members

(static) webServer

The webserver related configuration object, that will be merged into the container.config object.

Properties:
Name Type Description
logBlackList Array

The array of URIs that should not be logged. Default: []. Env.: WEBSERVER_LOG_BLACKLIST, the comma-separated list of URI strings.

port Number

The port where the webserver will listen. Env.: WEBSERVER_PORT. Default: 3007.

useCompression Boolean

If true then the server will use the compression middleware. Env: WEBSERVER_USE_COMPRESSION. Default: false.

useMessaging Boolean

If true the adapter will use the API call forwarding towards NATS topics. Env.: WEBSERVER_USE_MESSAGING. Default: false.

middlewares Object

The dictionary of middleware functions needs to be added. Defaults: { preRouting: [], postRouting: [] }.

restApiPath String

The path to the root file of the swagger/OpenApi descriptor file(s) Env.: WEBSERVER_RESTAPIPATH.

staticContentBasePath String

The base path to the static endpoints of the REST API. Env.: WEBSERVER_STATIC_CONTENT_BASEPATH.

ignoreApiOperationIds Boolean

Ignores the operationId property of the API endpoint descriptor if true. Env.: WEBSERVER_IGNORE_API_OPERATION_IDS. Default: false.

enableMocking Boolean

Responses the first example found in the examples array of endpoint descriptor if there is any. For proper working, it requires the ignoreApiOperationIds config parameter to be true in case the operationIds of the endpoints are defined. Env.: WEBSERVER_ENABLE_MOCKING. Default: false.

basePath String

Define the base-path (prefix) for the REST API endpoints. Env.: WEBSERVER_BASEPATH. Default: /.

oasConfig Object

The swagger-parser configuration object. Defaults: { parse: { yaml: { allowEmpty: false }, resolve: { file: true } } }

bodyParser Object

The request body parser configuration object. Defaults: all types default to false.