File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,10 @@ git clone https://github.com/wuhan2020/wuhan2020
9
9
pip install -r requirements.txt
10
10
bash bootstrap
11
11
```
12
+
12
13
然后就可以在` http://your-ip:9000/wuhan2020/ ` 调试api
14
+ 注意` list_path ` 是在` utils.py ` 中被` data.route ` 注册的path,
15
+ ` your-ip ` 默认是127.0.0.1
13
16
14
17
## Docker 容器运行
15
18
需要安装[ Docker客户端] ( https://www.docker.com/products/docker-desktop ) .
@@ -62,8 +65,9 @@ app.register_blueprint(data, url_prefix=path_prefix)
62
65
# 使用flask蓝图功能来注册http-router
63
66
64
67
if __name__ == ' __main__' :
68
+ # 使用aliyun默认端口9000
65
69
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))
67
71
```
68
72
## 前端项目issues
69
73
https://github.com/wuhan2020/front-pages/issues
Original file line number Diff line number Diff line change 1
1
# -*- coding: utf-8 -*-
2
2
from flask import Flask
3
3
from utils import data
4
+ import os
4
5
5
6
app = Flask (__name__ )
6
7
app .debug = True
7
8
path_prefix = "/wuhan2020"
8
9
# url请求前缀,在http路径中要加/wuhan2020/
9
10
app .register_blueprint (data , url_prefix = path_prefix )
10
- #使用flask蓝图功能来注册http-router
11
+ # 使用flask蓝图功能来注册http-router
11
12
12
13
13
14
def handler (environ , start_response ):
14
15
return app (environ , start_response )
15
16
16
17
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 ))
You can’t perform that action at this time.
0 commit comments