UNPKG

enhancer-recluster

Version:

Clustering library with support for zero-downtime reloading

19 lines (13 loc) 381 B
var http = require('http'); if (null == process.env.WORKER_ID) throw new Error("env.WORKER_ID not set!"); var s = http.createServer(function(req, res) { var params = req.url.split('/').slice(1); setTimeout(function() { res.writeHead(200); res.end("hello world\n"); }, params[0] || 1); }); setTimeout(function() { s.listen(9000); }, 200);