File size: 715 Bytes
9cf5fee
 
b089011
 
59ea016
 
9cf5fee
9e707a5
9cf5fee
59ea016
9cf5fee
 
59ea016
 
 
 
9cf5fee
 
 
 
 
b089011
9e707a5
9cf5fee
 
 
 
 
 
 
b089011
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
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
import os

# Import the router
from app.api.routes import router as api_router

app = FastAPI(title="AI Content Summariser API")

# Configure CORS
app.add_middleware(
    CORSMiddleware,
    allow_origins=[
        "https://ai-content-summariser.vercel.app",
        "http://localhost:3000",
    ],
    allow_credentials=True,
    allow_methods=["*"],
    allow_headers=["*"],
)

# Include the router
app.include_router(api_router)

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

if __name__ == "__main__":
    import uvicorn
    uvicorn.run(app, host="0.0.0.0", port=int(os.environ.get("PORT", 8000)))