Spaces:
Sleeping
Sleeping
| from fastapi import FastAPI | |
| from fastapi.middleware.cors import CORSMiddleware | |
| from app.routers import chats, analytics, invite, user, chatbots, members | |
| app = FastAPI(title="Auro Dashboard Backend", root_path="/admin") | |
| origins = [ | |
| "https://admin-dashboard-frontend-ten-xi.vercel.app", | |
| "http://localhost:5173", # optional for local dev | |
| ] | |
| # CORS — adjust for your frontend origin | |
| app.add_middleware( | |
| CORSMiddleware, | |
| allow_origins=origins, # allow all origins | |
| allow_credentials=True, | |
| allow_methods=["*"], | |
| allow_headers=["*"], | |
| ) | |
| # Routers | |
| app.include_router(chats.router) | |
| app.include_router(analytics.router) | |
| app.include_router(user.router) | |
| app.include_router(invite.router) | |
| app.include_router(chatbots.router) | |
| app.include_router(members.router) | |
| def root(): | |
| return {"message": "Dashboard Backend is running"} | |