aidpc commited on
Commit
c13d1c7
·
verified ·
1 Parent(s): 9dd2ec5

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -0
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}!"}