Skip to content

Commit 532ee58

Browse files
committed
feat: create src/index.py
1 parent 75694f4 commit 532ee58

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/index.py

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
from fastapi import FastAPI
2+
3+
from src.dtos.ISayHelloDto import ISayHelloDto
4+
5+
app = FastAPI()
6+
7+
8+
@app.get("/")
9+
async def root():
10+
return {"message": "Hello World"}
11+
12+
13+
@app.get("/hello/{name}")
14+
async def say_hello(name: str):
15+
return {"message": f"Hello {name}"}
16+
17+
18+
@app.post("/hello")
19+
async def hello_message(dto: ISayHelloDto):
20+
return {"message": f"Hello {dto.message}"}

0 commit comments

Comments
 (0)