From 52127adb08cff9e6bf6bad0125c3b5f7e0d04db2 Mon Sep 17 00:00:00 2001 From: Parker Date: Mon, 11 Nov 2024 23:57:44 -0600 Subject: Merge API+APP in Docker --- api/main.py | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'api') diff --git a/api/main.py b/api/main.py index 8ce333f..8be260d 100644 --- a/api/main.py +++ b/api/main.py @@ -67,20 +67,10 @@ async def log_redirect( return RedirectResponse(url=link_record.redirect_link) -# Redirect /api -> /api/docs -@app.get("/api") -async def redirect_to_docs(): - return RedirectResponse(url="/docs") - - # Custom handler for 404 errors @app.exception_handler(HTTP_404_NOT_FOUND) async def custom_404_handler(request: Request, exc: HTTPException): - # If the request is from /api, return a JSON response - if request.url.path.startswith("/api"): - return JSONResponse( - status_code=404, - content={"message": "Resource not found"}, - ) - # Otherwise, redirect to the login page - return RedirectResponse(url="/login") + return JSONResponse( + status_code=404, + content={"message": "Resource not found"}, + ) -- cgit v1.2.3-70-g09d2