MathTutor / backend /main.py
rsreenivasa's picture
Testing changes
c12625f
Raw History Blame Contribute Delete
1.83 kB
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from backend.core.config import settings
from backend.routers import badges, explain, practice, test
app = FastAPI(
title="MathMind AI API",
description="Adaptive math tutor backend β€” Grades 6–12",
version="1.0.0",
)
# ── CORS ───────────────────────────────────────────────────────────────────────
app.add_middleware(
CORSMiddleware,
allow_origins=settings.origins_list,
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
# ── Routers ────────────────────────────────────────────────────────────────────
app.include_router(explain.router)
app.include_router(practice.router)
app.include_router(test.router)
app.include_router(badges.router)
# ── Root ───────────────────────────────────────────────────────────────────────
@app.get("/", tags=["root"])
async def root():
return {
"message": "MathMind AI API is running",
"health": "/api/health",
"docs": "/docs",
}
# ── Health ─────────────────────────────────────────────────────────────────────
@app.get("/api/health", tags=["health"])
async def health():
return {"status": "ok", "service": "MathMind AI API", "version": "1.0.0"}