Spaces:
Sleeping
Sleeping
| from fastapi import FastAPI, Request, HTTPException | |
| from src.routers.public.public import router | |
| from src.utils.response import handler_error | |
| from src.services.AI.false_ans_generator import FalseAnswerGenerator | |
| app = FastAPI() | |
| async def exception_handler(request: Request, exc: Exception): | |
| return handler_error(exc) | |
| async def http_exception_handler(request: Request, exc: HTTPException): | |
| return handler_error(exc) | |
| def check_health(): | |
| return {"status": "ok"} | |
| app.include_router(router) | |
| if __name__ == "__main__": | |
| import os | |
| import uvicorn | |
| port = int(os.environ.get("PORT", 8000)) | |
| uvicorn.run(app, host="0.0.0.0", port=port) |