Spaces:
Sleeping
Sleeping
Ezi Ozoani
commited on
Commit
·
711adee
1
Parent(s):
cd2499e
fix app init
Browse files- __pycache__/main.cpython-310.pyc +0 -0
- __pycache__/server.cpython-310.pyc +0 -0
- server.py +3 -3
__pycache__/main.cpython-310.pyc
CHANGED
|
Binary files a/__pycache__/main.cpython-310.pyc and b/__pycache__/main.cpython-310.pyc differ
|
|
|
__pycache__/server.cpython-310.pyc
CHANGED
|
Binary files a/__pycache__/server.cpython-310.pyc and b/__pycache__/server.cpython-310.pyc differ
|
|
|
server.py
CHANGED
|
@@ -5,9 +5,9 @@ from tabulate import tabulate
|
|
| 5 |
|
| 6 |
KEY = os.environ.get("KEY")
|
| 7 |
|
| 8 |
-
|
| 9 |
|
| 10 |
-
@
|
| 11 |
def read_root():
|
| 12 |
data = """
|
| 13 |
<h2 style="text-align:center">Metadata Review Bot</h2>
|
|
@@ -15,7 +15,7 @@ def read_root():
|
|
| 15 |
"""
|
| 16 |
return Response(content=data, media_type="text/html")
|
| 17 |
|
| 18 |
-
@
|
| 19 |
async def webhook(request: Request):
|
| 20 |
if request.method == "POST":
|
| 21 |
if request.headers.get("X-Webhook-Secret") != KEY:
|
|
|
|
| 5 |
|
| 6 |
KEY = os.environ.get("KEY")
|
| 7 |
|
| 8 |
+
main = FastAPI()
|
| 9 |
|
| 10 |
+
@main.get("/")
|
| 11 |
def read_root():
|
| 12 |
data = """
|
| 13 |
<h2 style="text-align:center">Metadata Review Bot</h2>
|
|
|
|
| 15 |
"""
|
| 16 |
return Response(content=data, media_type="text/html")
|
| 17 |
|
| 18 |
+
@main.post("/webhook")
|
| 19 |
async def webhook(request: Request):
|
| 20 |
if request.method == "POST":
|
| 21 |
if request.headers.get("X-Webhook-Secret") != KEY:
|