Supply app port via config

This commit is contained in:
PCoder 2019-09-13 12:07:53 +05:30
parent 320ba43cdd
commit 85c9c4bacc
3 changed files with 12 additions and 2 deletions

View File

@ -3,6 +3,15 @@
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:
1. Adding of products

View File

@ -13,3 +13,4 @@ logging.basicConfig(
etcd_client = Etcd3Wrapper(host=config("ETCD_HOST"), port=config("ETCD_PORT"))
APP_PORT = config("APP_PORT", 5000)

View File

@ -1,7 +1,7 @@
import json
from flask import Flask, request
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__)
api = Api(app)
@ -41,4 +41,4 @@ api.add_resource(ListProducts, "/product/list")
api.add_resource(AddProduct, "/product/add")
if __name__ == '__main__':
app.run(host="::", debug=True)
app.run(host="::", port=APP_PORT, debug=True)