Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
|
@@ -77,7 +77,15 @@ async def optimize_resume(
|
|
| 77 |
except Exception as e:
|
| 78 |
logger.error(f"Unexpected error occurred: {str(e)}", exc_info=True)
|
| 79 |
raise HTTPException(status_code=500, detail=f"An unexpected error occurred: {str(e)}")
|
| 80 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 81 |
@app.exception_handler(HTTPException)
|
| 82 |
async def http_exception_handler(request: Request, exc: HTTPException):
|
| 83 |
return JSONResponse(status_code=exc.status_code, content={"detail": exc.detail})
|
|
|
|
| 77 |
except Exception as e:
|
| 78 |
logger.error(f"Unexpected error occurred: {str(e)}", exc_info=True)
|
| 79 |
raise HTTPException(status_code=500, detail=f"An unexpected error occurred: {str(e)}")
|
| 80 |
+
|
| 81 |
+
# Mount the static directory
|
| 82 |
+
app.mount("/static", StaticFiles(directory="static"), name="static")
|
| 83 |
+
|
| 84 |
+
# Add a route to serve the HTML file
|
| 85 |
+
@app.get("/")
|
| 86 |
+
async def read_index():
|
| 87 |
+
return FileResponse('static/resume-optimizer.html')
|
| 88 |
+
|
| 89 |
@app.exception_handler(HTTPException)
|
| 90 |
async def http_exception_handler(request: Request, exc: HTTPException):
|
| 91 |
return JSONResponse(status_code=exc.status_code, content={"detail": exc.detail})
|