5.0.7 • Published 1 year ago

npac-webserver-adapter v5.0.7

Weekly downloads
12
License
MIT
Repository
github
Last release
1 year ago
        

npac-webserver-adapter

Actions Status stable npm version

About

npac adapter with webServer api, using Express.js

It is a complete web server, that loads the API specification from swagger/OpenApi descriptors.

Use the public startup and shutdown functions defined in src/index.js within an npac container. To learn more about the functions visit the homepage. See also the test cases in src/index.spec.js as examples of how to configure and use the module.

Installation

Run the install command:

npm install --save npac-webserver-adapter

Configuration

This module uses the config.webServer property to gain its configuration parameters.

The default parameters can be found in src/config.js:

{
    webServer: {
        logBlackList: getLogBlackList(process.env.WEBSERVER_LOG_BLACKLIST),
        port: process.env.WEBSERVER_PORT || 3007,
        useCompression: process.env.WEBSERVER_USE_COMPRESSION || false,
        useResponseTime: process.env.WEBSERVER_USE_RESPONSE_TIME || false,
        usePdms: process.env.WEBSERVER_USE_PDMS || false,
        middlewares: { preRouting: [], postRouting: [] },
        restApiPath: process.env.WEBSERVER_RESTAPIPATH || __dirname,
        staticContentBasePath: process.env.WEBSERVER_STATIC_CONTENT_BASEPATH || path.resolve(),
        ignoreApiOperationIds: process.env.WEBSERVER_IGNORE_API_OPERATION_IDS || false,
        enableMocking: process.env.WEBSERVER_ENABLE_MOCKING || false,
        basePath: process.env.WEBSERVER_BASEPATH || '/',
        oasConfig: {
            parse: {
                yaml: {
                    allowEmpty: false // Don't allow empty YAML files
                },
                resolve: {
                    file: true // Resolve local file references
                }
            }
        },
        bodyParser: {
            raw: process.env.PARSE_RAW_BODY || true,
            json: process.env.PARSE_JSON_BODY || false,
            xml: process.env.PARSE_XML_BODY || false,
            urlencoded: process.env.PARSE_URL_ENCODED_BODY || false
        }
    }
}

5.0.6

1 year ago

5.0.5

1 year ago

5.0.4

1 year ago

5.0.3

1 year ago

5.0.2

1 year ago

5.0.1

1 year ago

5.0.0

1 year ago

5.0.7

1 year ago

4.0.5

2 years ago

4.0.4

2 years ago

4.0.6

2 years ago

4.0.3

2 years ago

4.0.2

2 years ago

4.0.0

3 years ago

3.0.5

3 years ago

3.0.3

3 years ago

3.0.2

5 years ago

3.0.1

5 years ago

3.0.0

5 years ago

2.6.1

5 years ago

2.6.0

5 years ago

2.5.2

5 years ago

2.5.1

5 years ago

2.5.0

5 years ago

2.4.1

5 years ago

2.4.0

5 years ago

2.3.0

5 years ago

2.2.0

5 years ago

2.1.1

5 years ago

2.1.0

5 years ago

2.0.0

5 years ago

1.3.1

5 years ago

1.3.0

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago