You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
573 B
Python

from os import getenv
from flask import Flask
from flask_socketio import SocketIO
from server import setup
import eventlet
eventlet.monkey_patch()
app = Flask(__name__)
app.secret_key = getenv('APP_SECRET')
if not app.secret_key:
print("Please set a secret key via environment variable APP_SECRET")
import sys
sys.exit(1)
socketio = SocketIO(app, async_mode='eventlet')
setup(app, socketio)
if __name__ == '__main__':
print("starting")
socketio.run(app, debug=(getenv('DEV', 'false') == 'true'), port=int(getenv('PORT', 5000)), host='0.0.0.0')