kumahiyo commited on
Commit
1ef45ad
1 Parent(s): 13e1233

add post method

Browse files
Files changed (1) hide show
  1. main.py +6 -2
main.py CHANGED
@@ -13,8 +13,12 @@ class ItemOut(BaseModel):
13
  status: str
14
  file: str
15
 
16
- @app.get("/", response_model=ItemOut)
17
- def index(data: Data):
 
 
 
 
18
  if data.member_secret != "" and data.member_secret == os.environ.get("MEMBER_SECRET"):
19
  return {"status": "OK", "file": "hello world!"}
20
  else:
 
13
  status: str
14
  file: str
15
 
16
+ @app.get("/")
17
+ def index():
18
+ return "SORRY! This file is member only."
19
+
20
+ @app.post("/draw", response_model=ItemOut)
21
+ def draw(data: Data):
22
  if data.member_secret != "" and data.member_secret == os.environ.get("MEMBER_SECRET"):
23
  return {"status": "OK", "file": "hello world!"}
24
  else: