-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathrun.py
More file actions
26 lines (20 loc) · 705 Bytes
/
run.py
File metadata and controls
26 lines (20 loc) · 705 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
"""
Main application runner for WhatsApp Message Hub
"""
import os
from app import create_app
from app.models import init_database
# Create Flask application
app = create_app()
if __name__ == '__main__':
# Initialize database
with app.app_context():
init_database(app.config['DB_PATH'])
# Run application
debug_mode = app.config.get('DEBUG', False)
host = os.environ.get('HOST', '0.0.0.0')
port = int(os.environ.get('PORT', 5001))
print(f"Starting WhatsApp Message Hub on {host}:{port}")
print(f"Debug mode: {debug_mode}")
print(f"Environment: {os.environ.get('FLASK_ENV', 'development')}")
app.run(debug=debug_mode, host=host, port=port)