Download app/main.py from isold/meloon: direct link, hf CLI and curl.
- Browser
- Download file 679 Bytes
-
https://huggingface.co/spaces/isold/meloon/resolve/main/app/main.py
- Command line
-
hf download hf://spaces/isold/meloon/app/main.py
-
curl -L -o main.py https://huggingface.co/spaces/isold/meloon/resolve/main/app/main.py
679 Bytes
| from fastapi import FastAPI | |
| from fastapi.middleware.cors import CORSMiddleware | |
| import uvicorn | |
| from app.core.config import settings | |
| from app.api.api import api_router | |
| app = FastAPI( | |
| title=settings.PROJECT_NAME, | |
| version=settings.PROJECT_VERSION, | |
| openapi_url=f"/api/v1/openapi.json" | |
| ) | |
| # Set all CORS enabled origins | |
| app.add_middleware( | |
| CORSMiddleware, | |
| allow_origins=["*"], | |
| allow_credentials=True, | |
| allow_methods=["*"], | |
| allow_headers=["*"], | |
| ) | |
| app.include_router(api_router, prefix="/api/v1") | |
| def root(): | |
| return {"message": "Welcome to MeloonChatBI API"} | |
| if __name__ == "__main__": | |
| uvicorn.run(app, host="0.0.0.0", port=7860) |