File tree Expand file tree Collapse file tree 3 files changed +8
-5
lines changed Expand file tree Collapse file tree 3 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ $ CONFIG_FILE=/path/to/config.js NODE_ENV=production node ./bin/www # or CONFIG_
111111
112112notice. you have to change ` loginSecret ` in config.js for security.
113113
114- ## Default listen Host/Port 127 .0.0.1 /3000
114+ ## Default listen Host/Port 0 .0.0.0 /3000
115115you can change like this.
116116
117117``` shell
Original file line number Diff line number Diff line change 77var app = require ( '../app' ) ;
88var debug = require ( 'debug' ) ( 'myapp1:server' ) ;
99var http = require ( 'http' ) ;
10-
10+ var validator = require ( 'validator' )
1111/**
1212 * Get port from environment and store in Express.
1313 */
1414
1515var port = normalizePort ( process . env . PORT || '3000' ) ;
16- var HOST = process . env . HOST || '127.0.0.1' ;
16+ var host = null ;
17+ if ( process . env . HOST && validator . isIP ( process . env . HOST ) ) {
18+ host = process . env . HOST ;
19+ }
1720app . set ( 'port' , port ) ;
1821
1922/**
@@ -26,7 +29,7 @@ var server = http.createServer(app);
2629 * Listen on provided port, on all network interfaces.
2730 */
2831
29- server . listen ( port , HOST ) ;
32+ server . listen ( port , host ) ;
3033server . on ( 'error' , onError ) ;
3134server . on ( 'listening' , onListening ) ;
3235
Original file line number Diff line number Diff line change 1515 A: “不复杂。很多网上的文章说复杂,是因为作者没有仔细理解官方文档,而且认为踩坑了。”
1616
1717 - Q: “为什么推荐code-push?”
18- A: ”非常好。除了满足基本更新功能外,还有统计,hash计算容错和差异化更新功能 。微软的项目,大公司技术有保障,而且开源。读大学的时候,个人非常讨厌微软, 近几年微软在拥抱开源方面,让大家也是刮目相看。“
18+ A: ”非常好。除了满足基本更新功能外,还有统计,hash计算容错和补丁更新功能 。微软的项目,大公司技术有保障,而且开源。近几年微软在拥抱开源方面,让大家也是刮目相看。“
1919
2020## 安装依赖包
2121
You can’t perform that action at this time.
0 commit comments