Supply app port via config
This commit is contained in:
parent
320ba43cdd
commit
85c9c4bacc
|
@ -3,6 +3,15 @@
|
||||||
The pay module for the ucloud
|
The pay module for the ucloud
|
||||||
|
|
||||||
|
|
||||||
|
## Getting started
|
||||||
|
|
||||||
|
```
|
||||||
|
pipenv shell
|
||||||
|
pipenv install
|
||||||
|
ETCD_HOST=127.0.0.1 ETCD_PORT=2379 python ucloud-pay.py
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
Currently handles very basic features, such as:
|
Currently handles very basic features, such as:
|
||||||
|
|
||||||
1. Adding of products
|
1. Adding of products
|
||||||
|
|
|
@ -13,3 +13,4 @@ logging.basicConfig(
|
||||||
|
|
||||||
|
|
||||||
etcd_client = Etcd3Wrapper(host=config("ETCD_HOST"), port=config("ETCD_PORT"))
|
etcd_client = Etcd3Wrapper(host=config("ETCD_HOST"), port=config("ETCD_PORT"))
|
||||||
|
APP_PORT = config("APP_PORT", 5000)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import json
|
import json
|
||||||
from flask import Flask, request
|
from flask import Flask, request
|
||||||
from flask_restful import Resource, Api
|
from flask_restful import Resource, Api
|
||||||
from config import etcd_client as client, logging
|
from config import etcd_client as client, logging, APP_PORT
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
api = Api(app)
|
api = Api(app)
|
||||||
|
@ -41,4 +41,4 @@ api.add_resource(ListProducts, "/product/list")
|
||||||
api.add_resource(AddProduct, "/product/add")
|
api.add_resource(AddProduct, "/product/add")
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
app.run(host="::", debug=True)
|
app.run(host="::", port=APP_PORT, debug=True)
|
||||||
|
|
Loading…
Reference in New Issue