25 lines
700 B
Python
25 lines
700 B
Python
|
|
from fastapi import FastAPI
|
|
from app.api.api import api_router
|
|
from app.core.config import settings
|
|
from fastapi.middleware.cors import CORSMiddleware
|
|
|
|
app = FastAPI(title=settings.PROJECT_NAME, openapi_url=f"{settings.API_V1_STR}/openapi.json")
|
|
|
|
# Set all CORS enabled origins
|
|
# Set all CORS enabled origins
|
|
# Always enable for dev to prevent frustration
|
|
app.add_middleware(
|
|
CORSMiddleware,
|
|
allow_origins=["http://localhost:3000", "http://localhost:5173", "*"],
|
|
allow_credentials=True,
|
|
allow_methods=["*"],
|
|
allow_headers=["*"],
|
|
)
|
|
|
|
app.include_router(api_router, prefix=settings.API_V1_STR)
|
|
|
|
@app.get("/")
|
|
async def root():
|
|
return {"message": "Auteur AI Backend is running"}
|