Skip to content

Instantly share code, notes, and snippets.

View nelreina's full-sized avatar
💭

Nelreina nelreina

💭
View GitHub Profile
@nelreina
nelreina / boot.js
Created October 10, 2016 13:01 — forked from jdx/boot.js
zero-downtime node.js app runner
// This script will boot app.js with the number of workers
// specified in WORKER_COUNT.
//
// The master will respond to SIGHUP, which will trigger
// restarting all the workers and reloading the app.
var cluster = require('cluster');
var workerCount = process.env.WORKER_COUNT || 2;
// Defines what each worker needs to run