Skip to content

Instantly share code, notes, and snippets.

@scq000
Created May 18, 2017 07:28
Show Gist options
  • Save scq000/22e8bb5959917859d47e5af0c1f96eec to your computer and use it in GitHub Desktop.
Save scq000/22e8bb5959917859d47e5af0c1f96eec to your computer and use it in GitHub Desktop.
var http = require('http');
module.exports = http.createServer(function(req, res){
console.log('%s %s', req.method, req.url);
var body = 'Hello World';
res.writeHead(200, { 'Content-Length': body.length });
res.end(body);
});
var cluster = require('cluster')
, app = require('./app');
cluster(app)
.use(cluster.logger('logs'))
.use(cluster.stats())
.use(cluster.pidfiles('pids'))
.use(cluster.cli())
.use(cluster.repl(8888))
.listen(3000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment