Spaces:
Sleeping
Sleeping
| from fastapi import FastAPI | |
| from fastapi.middleware.cors import CORSMiddleware | |
| from app.database import engine, Base | |
| from app.routes import admin, user, nutrition | |
| Base.metadata.create_all(bind=engine) | |
| app = FastAPI( | |
| title="Nutrition Analysis API", | |
| description="FastAPI backend for nutrition analysis with OCR and AI-powered recommendations", | |
| version="1.0.0" | |
| ) | |
| app.add_middleware( | |
| CORSMiddleware, | |
| allow_origins=["*"], | |
| allow_credentials=True, | |
| allow_methods=["*"], | |
| allow_headers=["*"], | |
| ) | |
| app.include_router(user.router) | |
| app.include_router(admin.router) | |
| app.include_router(nutrition.router) | |
| def root(): | |
| return { | |
| "message": "Welcome to Nutrition Analysis API", | |
| "docs": "/docs", | |
| "redoc": "/redoc" | |
| } | |
| def health_check(): | |
| return {"status": "healthy"} | |