Egg: 修改默认端口号的问题

Created on 7 Mar 2018  ·  5Comments  ·  Source: eggjs/egg

我搜索了我的整个工程,只有run/application_config.json里有7001端口的配置,但是修改成7331后,通过npm run dev启动服务,会自动将文件里的7331又改成了7001。请问是我找错位置了吗?正确的修改方式是什么?

Most helpful comment

@atian25 config.cluster.port 无效的

All 5 comments

看下文档吧,都有写的。

run 目录是运行期的 dump 文件,用于问题排查,非配置文件

修改 npm scripts 的 dev 为 egg-bin dev --port=7331
或者修改 config.cluster.listen.port

@atian25 config.cluster.port 无效的

提供最小可复现方式

@BoizZ
config.cluster = {
listen: {
port: 12345,
}
}

midwayjs中

"dev": "cross-env NODE_ENV=local midway-bin dev --port=3020 --ts",
Was this page helpful?
0 / 5 - 0 ratings

Related issues

jtyjty99999 picture jtyjty99999  ·  52Comments

XadillaX picture XadillaX  ·  44Comments

fengmk2 picture fengmk2  ·  44Comments

kkys4bfgp75be9p picture kkys4bfgp75be9p  ·  36Comments

shaoshuai0102 picture shaoshuai0102  ·  52Comments