Spaces:
Sleeping
Sleeping
kumahiyo
commited on
Commit
•
1ef45ad
1
Parent(s):
13e1233
add post method
Browse files
main.py
CHANGED
@@ -13,8 +13,12 @@ class ItemOut(BaseModel):
|
|
13 |
status: str
|
14 |
file: str
|
15 |
|
16 |
-
@app.get("/"
|
17 |
-
def index(
|
|
|
|
|
|
|
|
|
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:
|