forked from xzelencikova/ngo_naruc_project_be
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrunWaitressServer.py
More file actions
25 lines (21 loc) · 877 Bytes
/
Copy pathrunWaitressServer.py
File metadata and controls
25 lines (21 loc) · 877 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
import os
import sys
sys.path.append('.')
import customLogging
sys.path.append(os.path.dirname(__file__)+'/venv/Lib/site-packages')
from app import app
scriptName = os.path.basename(__file__)
scriptFolder = os.path.dirname(__file__)
logging = customLogging.setupCustomLogging(scriptName)
logging.info(scriptName + '| ------------------------------------------------------------')
logging.info(scriptName + '| Script name: [' + scriptName + ']')
if __name__ == '__main__':
from waitress import serve
try:
PORT = int(os.environ.get('SERVER_PORT', '5555'))
except ValueError:
PORT = 5555
logging.debug(scriptName + "| PORT: [" + str(PORT) + "]...")
logging.info(scriptName + "| Starting [waitress] on port [" + str(PORT) + "]...")
serve(app, host="localhost", port=PORT)
logging.info(scriptName + "| Ended execution of [waitress].")