How to run NuxtJS Application on a different port?

In this blog, we’ll show you how to run a NuxtJS Application on a port other than the default port number 3000.

If you like using `.env` (dotenv) file you can create a .env file at the root of the project directory and specify the port number by specifying value to the PORT variable.

Run Nuxt App in a different port

Restarting the server now runs on a port specified in the .env file.

Nuxt App running in a different port

Alternatively, you can run the app on a different port by specifying your desired port number to the npm run dev command.

npm run dev --port 4456
anishg Written by:

Hi!, I'm Anish Ghimire. Software Developer based in Kathmandu, Nepal.

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *