Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from fastapi import FastAPI
|
2 |
+
from pydantic import BaseModel
|
3 |
+
|
4 |
+
app=FastAPI()
|
5 |
+
|
6 |
+
class Input(BaseModel):
|
7 |
+
name: str
|
8 |
+
|
9 |
+
@app.post("/hello")
|
10 |
+
def say_hello(data: Input):
|
11 |
+
return {"message": f"Hello {data.name}!"}
|