Answer the question
In order to leave comments, you need to log in
Why doesn't the site launch via pm2 in production mode?
Something I can not start the site through pm2, can someone tell me why? In development mode, the site is launched in production mode, no, pm2 logs are clean, like the process is running and everything is fine, but on page 404
Ecosystem
module.exports = {
apps : [
{
name: "proto-dev.ru",
cwd: './proto-dev.ru',
script: "npm",
args: "start",
watch: true,
env: {
"NODE_ENV": "development",
},
env_production: {
"NODE_ENV": "production",
}
}
],
};
const express = require('express');
const next = require('next');
const port = parseInt(process.env.PORT, 10) || 8000;
const dev = process.env.NODE_ENV !== 'production';
const app = next({ dev });
const handle = app.getRequestHandler();
"scripts": {
"dev": "node server.js",
"build": "next build",
"start": "NODE_ENV=production node server.js"
},
pm2 restart ecosystem.config.js --env production
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question