Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

express-graceful

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-graceful

Gracefully start and stop express app

latest
Source
npmnpm
Version
0.0.2
Version published
Maintainers
1
Created
Source

express-graceful

Gracefully start and stop express app

Allows one to start listening immediately and queue requests until app is ready to process.

// returns app
var app = require('express-graceful')(require('express')());

// start listening as usual
app.listen();

// ... do db initialization, add route, async operations
// when pending requests are ready to be processed
app.ready();

why ?

Because in complicated setups one could need the application to be listening before completely initialized. The daemon starting the application would then let requests be handled to it, leading to 503 service failures from the proxy in front of the express application.

Planned feature

wait for requests to finish before shutting down app

Keywords

express

FAQs

Package last updated on 03 Mar 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts