Spaces:
Runtime error
Runtime error
Webhook route
Browse files
app.py
CHANGED
@@ -2,10 +2,18 @@
|
|
2 |
"""
|
3 |
|
4 |
from fastapi import FastAPI
|
|
|
5 |
|
6 |
|
|
|
|
|
7 |
app = FastAPI()
|
8 |
|
9 |
@app.get("/")
|
10 |
-
def
|
11 |
-
return
|
|
|
|
|
|
|
|
|
|
|
|
2 |
"""
|
3 |
|
4 |
from fastapi import FastAPI
|
5 |
+
from fastapi import Request
|
6 |
|
7 |
|
8 |
+
events = []
|
9 |
+
|
10 |
app = FastAPI()
|
11 |
|
12 |
@app.get("/")
|
13 |
+
async def get_events():
|
14 |
+
return events
|
15 |
+
|
16 |
+
@app.post("/webhook")
|
17 |
+
async def webhook(request: Request):
|
18 |
+
global events
|
19 |
+
events += [await request.json()]
|