Download src/app.py from lpetrl/Test-API: direct link, hf CLI and curl.
- Browser
- Download file 446 Bytes
-
https://huggingface.co/spaces/lpetrl/Test-API/resolve/main/src/app.py
- Command line
-
hf download hf://spaces/lpetrl/Test-API/src/app.py
-
curl -L -o app.py https://huggingface.co/spaces/lpetrl/Test-API/resolve/main/src/app.py
446 Bytes
| from fastapi import FastAPI | |
| from src.handlers import router | |
| from fastapi.middleware.cors import CORSMiddleware | |
| def get_application() -> FastAPI: | |
| application = FastAPI() | |
| application.add_middleware( | |
| CORSMiddleware, | |
| allow_origins=["*"], | |
| allow_credentials=True, | |
| allow_methods=["*"], | |
| allow_headers=["*"], | |
| ) | |
| application.include_router(router) | |
| return application | |
| app = get_application() | |