Spaces:
Running
Running
| from fastapi import FastAPI | |
| from fastapi.middleware.cors import CORSMiddleware | |
| from app.api.routes import router | |
| import os | |
| from pathlib import Path | |
| app = FastAPI(title="SmartNotes Backend") | |
| FRONTEND_URL = os.environ.get("FRONTEND_URL") | |
| app.add_middleware( | |
| CORSMiddleware, | |
| allow_origins=[ | |
| FRONTEND_URL | |
| ], | |
| allow_credentials=True, | |
| allow_methods=["*"], | |
| allow_headers=["*"], | |
| ) | |
| app.include_router(router, prefix="/api") | |
| def root(): | |
| return {"message": "SmartNotes API is running 🚀"} | |