commit c966bef31a329c1a0b0083424a71e0e8b171ac34 Author: Peter J. Holzer Date: Sun Aug 1 13:44:06 2021 +0200 Minimal fastapi api to test redirects diff --git a/main.py b/main.py new file mode 100755 index 0000000..292f4fc --- /dev/null +++ b/main.py @@ -0,0 +1,42 @@ +from fastapi import FastAPI +app = FastAPI() + +@app.get("/f1") +async def f1(): + return { + "name": "f1", + "slash": False, + } + + +@app.get("/d1") +async def f1(): + return { + "name": "d1", + "slash": False, + } + + +@app.get("/d1/f2") +async def f1(): + return { + "name": "f2", + "slash": False, + } + + +@app.get("/d2/") +async def f1(): + return { + "name": "d2", + "slash": True, + } + + +@app.get("/d2/f3") +async def f1(): + return { + "name": "f3", + "slash": False, + } + diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..97dc7cd --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +fastapi +uvicorn