mirror of
https://git.sleeping.town/mirrors/foxy-moxy
synced 2024-11-24 21:17:44 +00:00
14 lines
388 B
JavaScript
14 lines
388 B
JavaScript
|
const cluster = require('express-cluster');
|
||
|
const app = require('./server.js');
|
||
|
|
||
|
activePort = process.env.PORT || 3000;
|
||
|
|
||
|
cluster((worker) => {
|
||
|
app.listen(activePort, () => {
|
||
|
console.log('worker ' + worker.id + ' is listening on port ' + activePort);
|
||
|
});
|
||
|
}, {
|
||
|
'respawn': true, // workers will restart on failure
|
||
|
'verbose': true, // logs what happens to console
|
||
|
});
|