Spaces:
Sleeping
Sleeping
Download start_server_render.py from AlishbaRehman/fullbackend: direct link, hf CLI and curl.
- Browser
- Download file 502 Bytes
-
https://huggingface.co/spaces/AlishbaRehman/fullbackend/resolve/main/start_server_render.py
- Command line
-
hf download hf://spaces/AlishbaRehman/fullbackend/start_server_render.py
-
curl -L -o start_server_render.py https://huggingface.co/spaces/AlishbaRehman/fullbackend/resolve/main/start_server_render.py
502 Bytes
| import os | |
| import sys | |
| sys.path.append('.') | |
| # Set environment variables to ensure SQLite is used | |
| os.environ['NEON_DATABASE_URL'] = '' | |
| os.environ['DATABASE_URL'] = 'sqlite:///./todo_app.db' | |
| from src.main import create_app | |
| import uvicorn | |
| # Create the app instance with proper CORS configuration | |
| app = create_app() | |
| if __name__ == "__main__": | |
| port = int(os.environ.get("PORT", 8000)) | |
| # Use 0.0.0.0 instead of 127.0.0.1 for external access on Render | |
| uvicorn.run(app, host="0.0.0.0", port=port) |