2.1.0 • Published 2 years ago

@pubcore/node-server-docker v2.1.0

Weekly downloads
5
License
MIT
Repository
github
Last release
2 years ago

Package to create an Node.js web server based on express

The package's purpose is to offer a foundation for express based web apps, with general, none functional behaviour regarding security, logging and performance beeing integrated.

install

npm i @pubcore/node-server-docker

Example

'use strict'
const {app} = require('@pubcore/node-server-docker')
app.use((req, res) => res.send('Hello world!'))

Configuration environment variables with (default) value

  • APP_PORT (0)
    Application's ports
  • NODE_ENV (production)
    Type of environment, either 'development' or 'production'
  • RATE_WIN (3000), RATE_MAX (300)
    Rate limit values, see https://www.npmjs.com/package/express-rate-limit
  • TLS_KEY_DIR (/run/secrets)
    Path to the place where the TLS (SSL) key files for used domain are located. Required files: ssl-key, ssl-cert, ssl-dhparam
  • TLS_KEY_SOURCE (FILES)
    If set to "devcert" and corresponding npm package is installed, it is used to auto-generate a selfsigned certificate for localhost. Only in development mode possible (NODE_ENV == "development").
  • TOOBUSY_ENABLED (0), TOOBUSY_MAX_LAT (300), TOOBUSY_INTERVALL (1500)
    https://www.npmjs.com/package/toobusy-js
  • HTTP (false)
    If set to "true" TLS is disabled (not recommended)
  • ACCESS_LOG_ENABLED (true)
    If set to "false" access log of requests is disabled.

Health check via HEAD request to /healthcheck

2.1.0

2 years ago

2.0.0

2 years ago

1.8.0

3 years ago

1.7.0

4 years ago

1.6.3

4 years ago

1.6.2

4 years ago

1.6.1

4 years ago

1.6.0

4 years ago

1.5.1

4 years ago

1.4.2

5 years ago

1.4.1

5 years ago

1.4.0

6 years ago

1.3.0

6 years ago

1.2.0

6 years ago

1.1.0

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago