-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
35 lines (29 loc) · 821 Bytes
/
main.py
File metadata and controls
35 lines (29 loc) · 821 Bytes
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
import logger
import preload
import config
import response as resp
import checker
import sys
from flask import Flask
from flask_cors import CORS
__log = logger.Logger("main", True)
__config = config.Config()
app = Flask(__name__)
# Preload check===
# preload.preloadCheck()
if checker.checkServicesRequirements() == False:
__log.printerror("Failed to pass preload check, exiting...")
sys.exit(1)
app = checker.autoRegisterRouters(app)
CORS(app) # Add CORS support
# ================
# Routers =====
@app.route("/getServerStatus")
def getServerStatus():
return resp.sendResponse(resp.SUCCESS, "Server is running")
# =============
if __name__ == "__main__":
__log.printinfo("Starting main program...")
# run the app
app.run(debug=False, port=__config.getConfigFileContent("port"))
pass