File size: 652 Bytes
cd05673
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from app.api.v1.endpoints.moderation import router as moderation_router

app = FastAPI(
    title="Dynamic Moderation API",
    description="Moderates text and generates dynamic safe alternatives using AI.",
    version="1.0.0",
)

app.add_middleware(
    CORSMiddleware,
    allow_origins=["*"],  # Change to your frontend URL in production
    allow_credentials=True,
    allow_methods=["*"],
    allow_headers=["*"],
)

app.include_router(moderation_router, prefix="/api/v1")


@app.get("/health")
def health_check():
    return {"status": "ok"}