mirror of
https://github.com/Unitech/pm2.git
synced 2026-02-01 16:57:09 +00:00
24 lines
504 B
JavaScript
24 lines
504 B
JavaScript
|
|
var http = require('http');
|
|
|
|
var app = http.createServer(function(req, res) {
|
|
res.writeHead(200);
|
|
res.end('hey');
|
|
})
|
|
|
|
console.log(process.env.TOTO_ENV);
|
|
|
|
var listener = app.listen(0, function() {
|
|
console.log('Listening on port ' + listener.address().port);
|
|
});
|
|
|
|
process.on('message', function(msg) {
|
|
if (msg == 'shutdown') {
|
|
console.log('Closing all connections...');
|
|
setTimeout(function() {
|
|
console.log('Finished closing connections');
|
|
process.exit(0);
|
|
}, 100);
|
|
}
|
|
});
|