Answer the question
In order to leave comments, you need to log in
How to run a nuxt project on a different port?
There is a site on nuxtjs that runs the server on port 3000. For development, I decided to launch another server on port 3001.
To do this, I added the following code to package.json:
...
"scripts": {
"start_dev": "nuxt start --port 3001",
...
}
...
module.exports = {
apps: [{
name : "dev_script",
script : "npm",
watch: false,
args : "start_dev",
cwd : "./"
}]
};
Answer the question
In order to leave comments, you need to log in
pm2.json at root
{
"name": "xxx",
"script": "server.js",
"instances": "1",
"env": {
"NODE_ENV": "development",
"PORT": 3000
},
"env_production" : {
"NODE_ENV": "production",
"PORT": 3001
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question