Spaces:
Running
Running
File size: 671 Bytes
876b12f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware # β
Import this
from app.routers import analyze, health
app = FastAPI(title="MediaUnmasked API")
# β
Enable CORS for Swagger UI
app.add_middleware(
CORSMiddleware,
allow_origins=["*"], # Allow all origins (or specify ["http://localhost:7860"])
allow_credentials=True,
allow_methods=["*"], # Allow all methods
allow_headers=["*"], # Allow all headers
)
# Include routers
app.include_router(analyze.router, prefix="/api")
app.include_router(health.router, prefix="/health")
@app.get("/")
async def root():
return {"message": "MediaUnmasked API is running!"}
|