Skip to content

Commit 739246f

Browse files
Merge branch 'master' into master
2 parents 43eed25 + d7149f8 commit 739246f

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ git clone https://github.com/wuhan2020/wuhan2020
99
pip install -r requirements.txt
1010
bash bootstrap
1111
```
12+
1213
然后就可以在`http://your-ip:9000/wuhan2020/`调试api
14+
注意`list_path`是在`utils.py`中被`data.route`注册的path,
15+
`your-ip`默认是127.0.0.1
1316

1417
## Docker 容器运行
1518
需要安装[Docker客户端](https://www.docker.com/products/docker-desktop).
@@ -62,8 +65,9 @@ app.register_blueprint(data, url_prefix=path_prefix)
6265
#使用flask蓝图功能来注册http-router
6366

6467
if __name__ == '__main__':
68+
# 使用aliyun默认端口9000
6569
port = os.environ.get("FC_SERVER_PORT", "9000")
66-
app.run(host='0.0.0.0', port=int(port))
70+
app.run(host='127.0.0.1', port=int(port))
6771
```
6872
## 前端项目issues
6973
https://github.com/wuhan2020/front-pages/issues

index.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
# -*- coding: utf-8 -*-
22
from flask import Flask
33
from utils import data
4+
import os
45

56
app = Flask(__name__)
67
app.debug = True
78
path_prefix= "/wuhan2020"
89
# url请求前缀,在http路径中要加/wuhan2020/
910
app.register_blueprint(data, url_prefix=path_prefix)
10-
#使用flask蓝图功能来注册http-router
11+
# 使用flask蓝图功能来注册http-router
1112

1213

1314
def handler(environ, start_response):
1415
return app(environ, start_response)
1516

1617
if __name__ == '__main__':
17-
app.run(host='0.0.0.0')
18+
# 使用aliyun默认端口9000
19+
port = os.environ.get("FC_SERVER_PORT", "9000")
20+
app.run(host='127.0.0.1', port=int(port))

0 commit comments

Comments
 (0)