-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.py
More file actions
36 lines (29 loc) · 792 Bytes
/
Copy pathrun.py
File metadata and controls
36 lines (29 loc) · 792 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
36
import os
import logging
from app import create_app, socketio
# Load environment variables (optional for development)
try:
from dotenv import load_dotenv
load_dotenv()
except ImportError:
# dotenv not available in production, that's fine
pass
# Disable logging
logging.disable(logging.CRITICAL)
app = create_app()
logger = logging.getLogger(__name__)
if __name__ == '__main__':
try:
port = int(os.environ.get('PORT', 5000))
host = os.environ.get('HOST', '0.0.0.0')
debug = app.config['DEBUG']
socketio.run(
app,
host=host,
port=port,
debug=debug,
use_reloader=debug,
allow_unsafe_werkzeug=True
)
except Exception as e:
raise