PM2 ecosystem file calls src/app directly, should fix cluster problem.
This commit is contained in:
@@ -4,8 +4,9 @@ module.exports = {
|
||||
apps: [
|
||||
{
|
||||
name: 'traxxx',
|
||||
script: 'npm',
|
||||
args: 'run server:prod',
|
||||
// script: 'npm',
|
||||
// args: 'run server:prod',
|
||||
script: './src/app.js',
|
||||
exec_mode: 'cluster',
|
||||
instances: 2,
|
||||
restart_delay: 3000,
|
||||
|
||||
@@ -175,7 +175,9 @@ export default async function initServer() {
|
||||
app.use(router);
|
||||
|
||||
const port = process.env.PORT || config.web.port || 3000;
|
||||
app.listen(port);
|
||||
// const port = Math.round(Math.random() * 10000);
|
||||
|
||||
logger.info(`Server running at http://localhost:${port}`);
|
||||
app.listen(port, config.web.host);
|
||||
|
||||
logger.info(`Server running at http://${config.web.host}:${port}`);
|
||||
}
|
||||
|
||||
2
static
2
static
Submodule static updated: 1c4d379e1e...2af6f58ca1
Reference in New Issue
Block a user