from dotenv import load_dotenv load_dotenv() from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware import uvicorn from app.detector import detector from app.chatbot import chat app = FastAPI() # Add CORS middleware app.add_middleware( CORSMiddleware, allow_origins=["http://localhost:3000", "http://127.0.0.1:3000"], allow_credentials=True, allow_methods=["*"], allow_headers=["*"], ) app.include_router(detector, tags=["deepfake detector api"]) app.include_router(chat, tags=["chat api"]) if __name__ == "__main__": uvicorn.run("main:app", host="0.0.0.0", port=7860, reload=True)