Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions bin/web.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,12 @@ app.use(function(err, req, res, next) {
var server = app.listen(PORT, HOST, function () {
console.log('Listening at http://%s:%s%s', HOST, PORT, BASE_URL);
});

process.on('SIGTERM', function() {
// runit sends a SIGTERM, then waits 10 seconds and, if necessary,
// sends a SIGKILL. This lets us shut down gracefully.
server.close(function() {
console.log('Closed all server connections.');
process.exit(0);
});
});
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nuts-serve",
"version": "2.7.3",
"version": "2.7.4",
"description": "Server to make GitHub releases (private) available to download with Squirrel support",
"main": "./lib/index.js",
"homepage": "https://github.com/GitbookIO/nuts",
Expand Down