Spaces:
Runtime error
Runtime error
Download app/main.py from abdullah090809/FastAPI-Project: direct link, hf CLI and curl.
- Browser
- Download file 542 Bytes
-
https://huggingface.co/spaces/abdullah090809/FastAPI-Project/resolve/bb4b25f33972753e5ff545649133e43bf2aeb752/app/main.py
- Command line
-
hf download hf://spaces/abdullah090809/FastAPI-Project@bb4b25f33972753e5ff545649133e43bf2aeb752/app/main.py
-
curl -L -o main.py https://huggingface.co/spaces/abdullah090809/FastAPI-Project/resolve/bb4b25f33972753e5ff545649133e43bf2aeb752/app/main.py
542 Bytes
| from fastapi import FastAPI | |
| from app.database import Base, engine | |
| from app.routers import post, user, auth, vote | |
| from fastapi.middleware.cors import CORSMiddleware | |
| app = FastAPI() | |
| origins=["*"] | |
| app.add_middleware( | |
| CORSMiddleware, | |
| allow_origins=origins, | |
| allow_credentials=True, | |
| allow_methods=["*"], | |
| allow_headers=["*"], | |
| ) | |
| app.include_router(post.router) | |
| app.include_router(user.router) | |
| app.include_router(auth.router) | |
| app.include_router(vote.router) | |
| def home(): | |
| return {"message": "FastAPI Project"} |