UNPKG

rocksteady

Version:

Drink blazin' electric death, downtime! Fast, zero-downtime apps for production enviroments.

66 lines (57 loc) 1.75 kB
// Generated by CoffeeScript 1.9.1 var args, error, forceKillTimeout, host, opt, port, restartCooldown, serverModule, usage, watch, workers; args = process.argv.slice(2); error = function(message) { console.error(message); return process.exit(1); }; usage = function() { console.log('rocksteady server.js [options]\n\nOptions:\n --host Specify host address to bind to, defaults to localhost.\n --port Specify port to listen on.\n --workers Number of workers to start.\n --restart-cooldown Seconds to wait before respawning workers that die.\n --force-kill Seconds to wait before killing unresponsive worker.\n --watch Watch for and reload server/browser on changes.'); return process.exit(0); }; serverModule = args.shift(); while (opt = args.shift()) { switch (opt) { case '--host': case '-h': host = args.shift(); break; case '--port': case '-p': port = parseInt(args.shift(), 10); break; case '--workers': case '-n': workers = parseInt(args.shift(), 10); break; case '--force-kill': forceKillTimeout = parseInt(args.shift(), 10); break; case '--restart-cooldown': restartCooldown = parseInt(args.shift(), 10); break; case '--watch': case '-w': watch = true; break; case '--help': case '-h': usage(); break; default: if (opt.charAt(0) === '-') { error('Unrecognized option'); } } } if (serverModule == null) { usage(); } require('./').run(serverModule, { forceKillTimeout: forceKillTimeout, host: host, port: port, restartCooldown: restartCooldown, workers: workers }); //# sourceMappingURL=cli.js.map