Files
3cloud-backend/core/api_server.py
T
JamesBhattarai 7fea4a5bcc Chore: Move services into core
- Move app/, worker/, websocket_server/, migrations/, tests and the services to core/, which becomes a self-contained root
- .gitmodules path for the novnc submodule rewritten by git mv.
- Initial Step to split into core and cloud/community
2026-08-17 22:15:19 +05:45

26 lines
796 B
Python

"""
Entry point for running the Flask application.
"""
import os
from app import app, db
def setup_database():
"""
Set up the database by creating all tables and initializing with default data.
"""
print("Running setup database")
with app.app_context():
db.create_all() # Create database tables based on models
if __name__ == '__main__':
with app.app_context():
# Only run this function on initial start, don't run when the Flask debugger restarts
if os.environ.get('WERKZEUG_RUN_MAIN') != 'true':
# Set up the database before starting the app
setup_database()
# session.permanent = True
# app.permanent_session_lifetime = timedelta(minutes=5)
app.run(debug=True, port=5000, host="0.0.0.0")