Dan Walsh
Initial deployment of AI Content Summariser API
9cf5fee
raw
history blame
894 Bytes
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
import os
app = FastAPI(
title="AI Content Summariser API",
description="API for summarising text content using NLP models",
version="0.1.0"
)
# Configure CORS
origins = os.getenv("CORS_ORIGINS", "http://localhost:3000").split(",")
app.add_middleware(
CORSMiddleware,
allow_origins=origins,
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
@app.get("/")
async def root():
return {"message": "Welcome to the AI Content Summariser API"}
@app.get("/health")
async def health_check():
return {"status": "healthy"}
# Import and include API routes
from app.api.routes import router as api_router
app.include_router(api_router, prefix="/api")
if __name__ == "__main__":
import uvicorn
uvicorn.run("main:app", host="0.0.0.0", port=8000, reload=True)