We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
# .env PORT=3001 #http://localhost:3001/ NITRO_PORT=3001 #http://localhost:3001/
// nuxt.config.ts export default defineNuxtConfig({ devServer: { port: 3001, }, })
// package.json "scripts": { "dev": "nuxt dev --port 3001" }
优先级:未使用的端口(指定的端口被占用时)> 方式三 > 方式二 > NITRO_PORT > PORT
生产环境端口号,默认使用的是打包时开发环境的端口号,要修改生产环境端口号,目前只知道这一种方法,就是在node .output/server/index.mjs命令前面加上PORT=3001
// package.json "scripts": { "start": "PORT=3001 node .output/server/index.mjs" }
nuxt/nuxt#15910 https://nuxt.com/docs/getting-started/deployment#configuring-defaults-at-runtime
The text was updated successfully, but these errors were encountered:
No branches or pull requests
一、修改开发环境端口号
二、修改生产环境端口号
生产环境端口号,默认使用的是打包时开发环境的端口号,要修改生产环境端口号,目前只知道这一种方法,就是在node .output/server/index.mjs命令前面加上PORT=3001
相关链接
nuxt/nuxt#15910
https://nuxt.com/docs/getting-started/deployment#configuring-defaults-at-runtime
The text was updated successfully, but these errors were encountered: