17 lines
381 B
JavaScript
17 lines
381 B
JavaScript
import { createServer } from 'http';
|
|
|
|
var app = createServer(function (req, res) {
|
|
res.writeHead(200);
|
|
setTimeout(() => {
|
|
res.end('pm2');
|
|
}, 2000);
|
|
});
|
|
|
|
var listener = app.listen(33333, function () {
|
|
console.log('Listening on port ' + listener.address().port);
|
|
setTimeout(() => {
|
|
// Here we send the ready signal to PM2
|
|
process.send('ready');
|
|
}, 5000);
|
|
});
|