Spaces:
Sleeping
Sleeping
File size: 1,077 Bytes
4689a82 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from routes import analyze
from config import settings
import os
# Create upload directories
os.makedirs(settings.UPLOAD_DIR, exist_ok=True)
os.makedirs(settings.CHROMA_PERSIST_DIRECTORY, exist_ok=True)
# Initialize FastAPI app
app = FastAPI(
title=settings.APP_NAME,
description="Resume Score Analyzer - AI-powered resume analysis with improvement suggestions",
version="1.0.0"
)
# CORS middleware - allow all for deployment
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
# Include routers
app.include_router(analyze.router)
@app.get("/")
def root():
return {
"message": "Resume Score Analyzer API",
"version": "1.0.0",
"docs": "/docs"
}
@app.get("/health")
def health_check():
return {"status": "healthy"}
if __name__ == "__main__":
import uvicorn
uvicorn.run("main:app", host=settings.HOST, port=settings.PORT, reload=settings.DEBUG)
|