diff --git a/api/code/metroplanner_api/metroplanner_api.py b/api/code/metroplanner_api/metroplanner_api.py index b773a1b..a88b7cf 100644 --- a/api/code/metroplanner_api/metroplanner_api.py +++ b/api/code/metroplanner_api/metroplanner_api.py @@ -6,11 +6,14 @@ from . import responses -app = FastAPI(servers=[{"url": ENV.api_url, "description": "CloudFront URL"}]) +app = FastAPI( + servers=[{"url": ENV.api_url, "description": "CloudFront URL"}], + root_path_in_servers=False, +) from . import v1 -router = APIRouter(prefix="/api") +router = APIRouter(prefix="/dev/api") router.include_router(v1.router) app.include_router(router) diff --git a/api/code/metroplanner_api/responses.py b/api/code/metroplanner_api/responses.py index 2def283..dc235f6 100644 --- a/api/code/metroplanner_api/responses.py +++ b/api/code/metroplanner_api/responses.py @@ -24,30 +24,30 @@ def bad_request_400(): def unauthorized_401(): - raise HTTPException(statusCode=401, body="Unauthorized") + raise HTTPException(status_code=401, body="Unauthorized") def forbidden_403(): - raise HTTPException(statusCode=403, body="Forbidden") + raise HTTPException(status_code=403, body="Forbidden") # using 410 over 404 as a workaround, since AWS CloudFront will return index.html on 404 errors def gone_410(): - raise HTTPException(statusCode=410, body="Gone") + raise HTTPException(status_code=410, body="Gone") def method_not_allowed_405(): - raise HTTPException(statusCode=405, body="Method Not Allowed") + raise HTTPException(status_code=405, body="Method Not Allowed") def not_acceptable_406(): - raise HTTPException(statusCode=406, body="Not Acceptable") + raise HTTPException(status_code=406, body="Not Acceptable") ### 5xx def internal_server_error_500(): - raise HTTPException(statusCode=500, body="Internal Server Error") + raise HTTPException(status_code=500, body="Internal Server Error") def not_implemented_501(): - raise HTTPException(statusCode=501, body="Not Implemented") + raise HTTPException(status_code=501, body="Not Implemented")