-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
63 lines (49 loc) · 1.68 KB
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
from flask import Flask
from flask_restful import Api
from flask_cors import CORS
from environs import Env
from src.controllers import user
env = Env()
env.read_env()
# reading the string value for the boolean typeS
debug_mode = env('DEBUG_MODE') == 'true'
app = Flask(__name__)
CORS(app, max_age=600, supports_credentials=True)
# cors = CORS(app)
api = Api(app)
# User Endpoints
api.add_resource(user.Register, '/register')
api.add_resource(user.Login, '/login')
api.add_resource(user.Protected, '/protected')
# # Business Endpoints
# # region
# api.add_resource(orders.BusinessUserPaymentData, '/biz/orders/data')
# # endregion
# # Order Endpoints
# # region
# api.add_resource(orders.OrderHistory, '/orders/data')
# # endregion
# # Agent Enpoints
# # region
# api.add_resource(agent.AgentsInfo,
# '/agents')
# api.add_resource(agent.AgentsInfoDownload,
# '/agents/download')
# api.add_resource(agent.AgentOrderCashInfo,
# '/agent/<agent_id>/collection_history')
# api.add_resource(agent.AgentOrderCashInfoDownload,
# '/agent/<agent_id>/collection_history_download')
# api.add_resource(agent.CashCollectionTotalInfo,
# '/agents/collection_history_download')
# api.add_resource(agent.AgentRoutingModal,
# '/agent/<agent_id>/routemap')
# endregion
@app.route("/")
def hello():
return "<h1 style='color:blue'>Hello There!</h1>"
# Name is only set to main when file is explicitly run (not on imports):
if __name__ == '__main__':
# TODO debug mode if staging, not in production
print('Dev Mode - ', debug_mode)
# print(type(debug_mode))
app.run(port=5000, debug=debug_mode, host="0.0.0.0")