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_
111
111
112
112
notice. you have to change ` loginSecret ` in config.js for security.
113
113
114
- ## Default listen Host/Port 127 .0.0.1 /3000
114
+ ## Default listen Host/Port 0 .0.0.0 /3000
115
115
you can change like this.
116
116
117
117
``` shell
Original file line number Diff line number Diff line change 7
7
var app = require ( '../app' ) ;
8
8
var debug = require ( 'debug' ) ( 'myapp1:server' ) ;
9
9
var http = require ( 'http' ) ;
10
-
10
+ var validator = require ( 'validator' )
11
11
/**
12
12
* Get port from environment and store in Express.
13
13
*/
14
14
15
15
var 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
+ }
17
20
app . set ( 'port' , port ) ;
18
21
19
22
/**
@@ -26,7 +29,7 @@ var server = http.createServer(app);
26
29
* Listen on provided port, on all network interfaces.
27
30
*/
28
31
29
- server . listen ( port , HOST ) ;
32
+ server . listen ( port , host ) ;
30
33
server . on ( 'error' , onError ) ;
31
34
server . on ( 'listening' , onListening ) ;
32
35
Original file line number Diff line number Diff line change 15
15
A: “不复杂。很多网上的文章说复杂,是因为作者没有仔细理解官方文档,而且认为踩坑了。”
16
16
17
17
- Q: “为什么推荐code-push?”
18
- A: ”非常好。除了满足基本更新功能外,还有统计,hash计算容错和差异化更新功能 。微软的项目,大公司技术有保障,而且开源。读大学的时候,个人非常讨厌微软, 近几年微软在拥抱开源方面,让大家也是刮目相看。“
18
+ A: ”非常好。除了满足基本更新功能外,还有统计,hash计算容错和补丁更新功能 。微软的项目,大公司技术有保障,而且开源。近几年微软在拥抱开源方面,让大家也是刮目相看。“
19
19
20
20
## 安装依赖包
21
21
You can’t perform that action at this time.
0 commit comments