mirror of
https://github.com/FAUSheppy/atlantis-event-dispatcher
synced 2025-12-06 06:21:36 +01:00
feat: add uwsgi/waitress support
This commit is contained in:
22
app.py
Normal file
22
app.py
Normal file
@@ -0,0 +1,22 @@
|
||||
import interface
|
||||
import os
|
||||
import sys
|
||||
|
||||
def createApp(envivorment=None, start_response=None):
|
||||
|
||||
# check files & environment
|
||||
signal = os.environ.get("SIGNAL_CLI_BIN")
|
||||
if not os.environ.get("SIGNAL_API_PASS"):
|
||||
print("SIGNAL_API_PASS must be set in enviromenment", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
elif not os.path.isfile(interface.SIGNAL_USER_FILE):
|
||||
print("{} does not exist.".format(interface.SIGNAL_USER_FILE), file=sys.stderr)
|
||||
sys.exit(1)
|
||||
elif not os.path.getsize(interface.SIGNAL_USER_FILE) > 0:
|
||||
print("{} is empty.".format(interface.SIGNAL_USER_FILE), file=sys.stderr)
|
||||
sys.exit(1)
|
||||
elif not signal or not os.path.isfile(signal):
|
||||
print("SIGNAL_CLI_BIN not set or does not exist.", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
return interface.app
|
||||
Reference in New Issue
Block a user