webhook/app/main.py

17 lines
387 B
Python
Raw Permalink Normal View History

2021-07-28 09:51:48 +00:00
from fastapi import FastAPI, Request, Depends
from fastapi_responses import custom_openapi
2022-02-20 05:52:15 +00:00
from app.dependencies import auth_hook, auth_web
2021-07-28 09:51:48 +00:00
app = FastAPI()
app.openapi = custom_openapi(app)
@app.get("/", dependencies=[Depends(auth_web)])
2022-02-20 05:52:15 +00:00
@app.post("/", dependencies=[Depends(auth_hook)])
2021-07-28 09:51:48 +00:00
async def hook(req: Request):
2022-02-21 02:25:35 +00:00
json = await req.json()
print(json)
2021-07-28 09:51:48 +00:00
return "Update"