Spaces:
Sleeping
Sleeping
Download serve.py from Arif-Badhon/Generative_AI_Project: direct link, hf CLI and curl.
- Browser
- Download file 349 Bytes
-
https://huggingface.co/spaces/Arif-Badhon/Generative_AI_Project/resolve/main/serve.py
- Command line
-
hf download hf://spaces/Arif-Badhon/Generative_AI_Project/serve.py
-
curl -L -o serve.py https://huggingface.co/spaces/Arif-Badhon/Generative_AI_Project/resolve/main/serve.py
349 Bytes
| from fastapi import FastAPI | |
| from fastapi.staticfiles import StaticFiles | |
| from app.main import app as backend_app | |
| main_app = FastAPI() | |
| # Backend API at /api | |
| main_app.mount("/api", backend_app) | |
| # Frontend served at / | |
| main_app.mount("/", StaticFiles(directory="static", html=True), name="static") | |
| app = main_app # Hugging Face expects this variable | |