env
This commit is contained in:
parent
7a395c14b1
commit
f0af5af3e8
|
@ -2,3 +2,4 @@
|
|||
.vscode/
|
||||
__pycache__/
|
||||
poetry.lock
|
||||
.env
|
|
@ -1,5 +1,5 @@
|
|||
import os
|
||||
import logging
|
||||
import uuid
|
||||
from dotenv import load_dotenv
|
||||
|
||||
load_dotenv()
|
||||
|
@ -9,3 +9,5 @@ logging.basicConfig(
|
|||
)
|
||||
logging.getLogger("httpx").setLevel(logging.WARNING)
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
WEBHOOK = os.getenv('WEBHOOK')
|
12
app/main.py
12
app/main.py
|
@ -1,7 +1,8 @@
|
|||
from typing import Union
|
||||
from fastapi import FastAPI
|
||||
import requests
|
||||
import json
|
||||
from fastapi import FastAPI, Request
|
||||
|
||||
from app.constants import logger
|
||||
from app.constants import *
|
||||
|
||||
app = FastAPI()
|
||||
|
||||
|
@ -12,10 +13,6 @@ def read_root():
|
|||
|
||||
|
||||
@app.post("/integration")
|
||||
<<<<<<< Updated upstream
|
||||
def intgr(body):
|
||||
logger.info(body)
|
||||
=======
|
||||
async def intgr(request: Request):
|
||||
body = await request.json()
|
||||
ref = body["ref"]
|
||||
|
@ -37,5 +34,4 @@ async def intgr(request: Request):
|
|||
f"&fields[POST_MESSAGE]={bx_comment}"
|
||||
)
|
||||
logger.info(f"result {json.loads(bx_res.text)}")
|
||||
>>>>>>> Stashed changes
|
||||
return {"status": "success"}
|
||||
|
|
Loading…
Reference in New Issue