Spaces:
Sleeping
Sleeping
| from fastapi import FastAPI | |
| from fastapi.middleware.cors import CORSMiddleware | |
| from routes.health import router as health_router | |
| from routes.analyze import router as analyze_router | |
| app = FastAPI(title="TruthLens API",description="AI-powered misinformation detection and trust analysis backend.", | |
| version="1.0.0") | |
| app.add_middleware( | |
| CORSMiddleware, | |
| allow_origins=["*"], | |
| allow_credentials=True, | |
| allow_methods=["*"], | |
| allow_headers=["*"],) | |
| app.include_router( | |
| health_router, | |
| prefix="/health", | |
| tags=["Health"]) | |
| app.include_router(analyze_router,prefix="/analyze",tags=["Analysis"]) | |
| def root(): | |
| return { | |
| "project": "TruthLens", | |
| "message": "TruthLens Backend API is running successfully.", | |
| "version": "1.0.0", | |
| "status": "Healthy" | |
| } | |
| if __name__ == "__main__": | |
| import uvicorn | |
| uvicorn.run("main:app",host="0.0.0.0",port=8000,reload=True) | |