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