#Change port for built nuxt app

4 messages · Page 1 of 1 (latest)

gusty sphinx
#

Hi all. Now i have a problem with the default port of built nuxt app. When i run built nuxt app by default it run on port 3000, but i want to config it to run on port 3001. How can i do this ? Thanks all !

brazen granite
#

go to your root directory in package.json and change this scripts

"scripts": {
"dev": "nuxt dev --port 3001",
},

bright mist
#

Set the PORT env variable to 3001 when running the build app. If you use the default node path/to/server.mjs command to run it, you can change it to PORT=3001 node path/to/server.mjs (on Mac and Linux)

gusty sphinx