Skip to content

Commit a48c65e

Browse files
committed
default listen host 0.0.0.0
1 parent 5689a4d commit a48c65e

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ $ CONFIG_FILE=/path/to/config.js NODE_ENV=production node ./bin/www # or CONFIG_
111111

112112
notice. 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
115115
you can change like this.
116116

117117
```shell

bin/www

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,16 @@
77
var app = require('../app');
88
var debug = require('debug')('myapp1:server');
99
var http = require('http');
10-
10+
var validator = require('validator')
1111
/**
1212
* Get port from environment and store in Express.
1313
*/
1414

1515
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+
}
1720
app.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);
3033
server.on('error', onError);
3134
server.on('listening', onListening);
3235

docs/react-native-code-push.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
A: “不复杂。很多网上的文章说复杂,是因为作者没有仔细理解官方文档,而且认为踩坑了。”
1616

1717
- Q: “为什么推荐code-push?”
18-
A: ”非常好。除了满足基本更新功能外,还有统计,hash计算容错和差异化更新功能。微软的项目,大公司技术有保障,而且开源。读大学的时候,个人非常讨厌微软,近几年微软在拥抱开源方面,让大家也是刮目相看。“
18+
A: ”非常好。除了满足基本更新功能外,还有统计,hash计算容错和补丁更新功能。微软的项目,大公司技术有保障,而且开源。近几年微软在拥抱开源方面,让大家也是刮目相看。“
1919

2020
## 安装依赖包
2121

0 commit comments

Comments
 (0)