Spaces:
Runtime error
Runtime error
Sync
Browse files
app.py
CHANGED
@@ -23,13 +23,13 @@ items = []
|
|
23 |
url_re = re.compile(r'https://s3\.amazonaws\.com/moonup/production/uploads/\d+-noauth\.jpeg')
|
24 |
|
25 |
@app.get("/")
|
26 |
-
|
27 |
return items
|
28 |
|
29 |
@app.post("/webhook")
|
30 |
-
|
31 |
global items
|
32 |
-
payload =
|
33 |
event = payload["event"]
|
34 |
if event["action"] != "create":
|
35 |
return
|
|
|
23 |
url_re = re.compile(r'https://s3\.amazonaws\.com/moonup/production/uploads/\d+-noauth\.jpeg')
|
24 |
|
25 |
@app.get("/")
|
26 |
+
def get_events():
|
27 |
return items
|
28 |
|
29 |
@app.post("/webhook")
|
30 |
+
def webhook(request: Request):
|
31 |
global items
|
32 |
+
payload = request.json()
|
33 |
event = payload["event"]
|
34 |
if event["action"] != "create":
|
35 |
return
|