1.1.3 • Published 5 years ago

express-graceful-shutdown v1.1.3

Weekly downloads
529
License
ISC
Repository
github
Last release
5 years ago

express-graceful-shutdown

Ensure that during shutdown express returns correctly with a 503

build status

Installation

npm install express-graceful-shutdown --save

Options

  • logger: a logger that provides info, warn, and error functions for recording graceful shutdown. Default: console.
  • forceTimeout: number of milliseconds to wait for server.close() to complete before calling process.exit(1). Default: 30000.

Usage

var express = require('express'),
  app = express(),
  createGracefulShutdownMiddleware = require('express-graceful-shutdown'),
  http = require('http'),
  server = http.createServer(app)

app.use(createGracefulShutdownMiddleware(server, { forceTimeout: 30000 }))

app.get('/', function(req, res) {
  res.json({ foo: 'bar' })
})

server.listen(3000)

Prettier

This project uses prettier for code formatting and linting. You can set prettier up to auto format code in your editor, or manually format code before committing with yarn prettier.

Credits

Paul Serby follow me on twitter @serby

License

Licensed under the ISC

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.0.0

6 years ago

0.0.3

8 years ago

0.0.2

9 years ago

0.0.1

10 years ago