1
0
Fork 0
nodejs-backend-template/server/index.js

15 lines
323 B
JavaScript

const app = require('./../app');
const cluster = require('cluster');
/**
* Server startup
*/
if (cluster.isMaster) {
require('./worker')();
} else {
const port = process.env.PORT || 8080;
const server = app.listen(port, () => {
console.log(`App running on port ${port}...`);
});
server.setTimeout(3600000);
}