File size: 957 Bytes
c8b1fd7
 
 
c53ee74
c8b1fd7
c53ee74
c8b1fd7
 
c53ee74
 
c8b1fd7
 
c53ee74
c8b1fd7
 
c53ee74
 
c8b1fd7
 
 
 
c53ee74
 
 
c8b1fd7
 
 
 
 
 
c53ee74
 
c8b1fd7
c53ee74
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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"])


@app.get("/")
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)