From b6e38faf85b76fde38c0eaa664212cc8846af5e8 Mon Sep 17 00:00:00 2001 From: fakz9 Date: Fri, 28 Jun 2024 21:06:38 +0300 Subject: [PATCH] test --- .gitignore | 2 ++ main.py | 13 +++++++++++++ test_main.http | 11 +++++++++++ 3 files changed, 26 insertions(+) create mode 100644 .gitignore create mode 100644 main.py create mode 100644 test_main.http diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..dfcd050 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.venv/ +.idea/ diff --git a/main.py b/main.py new file mode 100644 index 0000000..6d7c6d9 --- /dev/null +++ b/main.py @@ -0,0 +1,13 @@ +from fastapi import FastAPI + +app = FastAPI() + + +@app.get("/") +async def root(): + return {"message": "Hello World"} + + +@app.get("/hello/{name}") +async def say_hello(name: str): + return {"message": f"Hello {name}"} diff --git a/test_main.http b/test_main.http new file mode 100644 index 0000000..a2d81a9 --- /dev/null +++ b/test_main.http @@ -0,0 +1,11 @@ +# Test your FastAPI endpoints + +GET http://127.0.0.1:8000/ +Accept: application/json + +### + +GET http://127.0.0.1:8000/hello/User +Accept: application/json + +###