Spaces:
Sleeping
Sleeping
Download app/main.py from abdullah090809/Job_Tracker_API: direct link, hf CLI and curl.
- Browser
- Download file 716 Bytes
-
https://huggingface.co/spaces/abdullah090809/Job_Tracker_API/resolve/main/app/main.py
- Command line
-
hf download hf://spaces/abdullah090809/Job_Tracker_API/app/main.py
-
curl -L -o main.py https://huggingface.co/spaces/abdullah090809/Job_Tracker_API/resolve/main/app/main.py
716 Bytes
| from fastapi import FastAPI | |
| from fastapi.middleware.cors import CORSMiddleware | |
| from fastapi.staticfiles import StaticFiles | |
| from app.routers import application, auth, user | |
| app = FastAPI(title="Job Tracker API") | |
| app.add_middleware( | |
| CORSMiddleware, | |
| allow_origins=["*"], # tighten this to your actual frontend domain once deployed | |
| allow_credentials=True, | |
| allow_methods=["*"], | |
| allow_headers=["*"], | |
| ) | |
| app.include_router(auth.router) | |
| app.include_router(user.router) | |
| app.include_router(application.router) | |
| # Serve the frontend (static/index.html) at "/". | |
| # Must be mounted AFTER the routers above so API routes take priority. | |
| app.mount("/", StaticFiles(directory="static", html=True), name="static") |