nodejs 生产环境配置

1.node 默认为development(开发)模式

启动node 时可以设置模式为生产模式

set NODE_ENV=production
node app.js

2.设置node监听的端口
var port = normalizePort(process.env.PORT || '5000');//程序中这样设置,默认为5000端口

当命令台启动程序时如下设置,则端口配置为1234.

set PORT=1234

node app.js
 
posted @ 2016-05-01 17:37  致敬科神  阅读(875)  评论(0编辑  收藏  举报