Agent turn complete

This commit is contained in:
VibeCoder
2026-09-07 19:32:02 +05:30 Unverified
commit 0a87bf68b5
39 changed files with 4301 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
"""FastAPI entry point. Deploy imports ``app.main:app`` — keep both names."""
import os
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from app.routes import api_router
from app.database import init_db
app = FastAPI(title=os.getenv("APP_NAME", "app"))
# Initialize database tables on startup
init_db()
# Allowed origins come from the environment so the deployed app and local dev
# use the same code path. "*" only when nothing is configured (dev default).
_origins = [o.strip() for o in os.getenv("CORS_ORIGINS", "*").split(",") if o.strip()]
app.add_middleware(
CORSMiddleware,
allow_origins=_origins,
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
# The one place the /api prefix is applied. Route modules must not repeat it.
app.include_router(api_router, prefix="/api")