nuxt3的项目,传到服务器上了,运行需要修改端口,现在默认3000和其他项目冲突了。
我之前尝试在 nuxt.config.ts 中修改:
import { defineNuxtConfig } from 'nuxt'
// https://v3.nuxtjs.org/api/configuration/nuxt.config
export default defineNuxtConfig({
runtimeConfig: {
// port: '3339'
// NITRO_PORT: 3339,
// PORT: 3339
public: {
port: '3339'
// port: 3339
}
}
})
改了之后没有作用,希望大家帮忙,感谢!
我看了nuxt2的写法,
server: {
port: 8000, // default: 3000
host: '0.0.0.0' // default: localhost
}
这么写也没有作用,求解
这种情况,需要改下服务器上的端口,而不是项目中的配置,比如:
https://v3.nuxtjs.org/guide/d...
https://nitro.unjs.io/deploy/...