model-eval-be / app.py
Ahmet Kaan Sever
Changed loop type to asyncio
976ac39
import uvicorn
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from svc.router import router
import asyncio
import sys
# Disable uvloop by setting default asyncio policy
if sys.platform == "win32":
# If running on Windows, you can skip applying the loop policy
pass
else:
asyncio.set_event_loop_policy(asyncio.DefaultEventLoopPolicy())
app = FastAPI(
title="Resume Generator API",
description="API for converting audio/text to structured resume with PDF generation",
version="1.0.0"
)
# Add CORS middleware
app.add_middleware(
CORSMiddleware,
allow_origins=["*"], # Modify this in production
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
# Include our router
app.include_router(router, prefix="/api")
@app.get("/")
async def health_check():
return {"status": "healthy"}
if __name__ == "__main__":
uvicorn.run(app, host="0.0.0.0", port=8080, loop="asyncio")