From c13ae5bb27321531403caad0da13b8f393cbc046 Mon Sep 17 00:00:00 2001 From: Birger Schacht Date: Mon, 13 Jan 2025 09:42:09 +0100 Subject: [PATCH] feat(api): redirect root to /docs --- pfp_api/main.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pfp_api/main.py b/pfp_api/main.py index 9deb87d..1302820 100644 --- a/pfp_api/main.py +++ b/pfp_api/main.py @@ -2,7 +2,8 @@ from base64 import urlsafe_b64decode from jinja2 import Environment, PackageLoader from typing import Annotated -from fastapi import FastAPI, Query, Response, status, HTTPException +from fastapi import FastAPI, Query, HTTPException +from fastapi.responses import RedirectResponse from rdfproxy import Page, SPARQLModelAdapter, QueryParameters @@ -17,9 +18,9 @@ class PersonParams(QueryParameters): label: str = None -@app.get("/") +@app.get("/", response_class=RedirectResponse, status_code=302) def root(): - return Response(status_code=status.HTTP_200_OK) + return "/docs" @app.get("/persons")