fastapi / main.py
mobixconsulting's picture
Update main.py
e94aa29 verified
raw
history blame
371 Bytes
from fastapi import FastAPI
import requests
app = FastAPI()
@app.get("/")
async def root():
return {"message": "Hello World"}
@app.get("/eatc-headers/{eatc_code}")
async def get_eatc_headers(eatc_code: str):
url = f"https://donantes.eatcloud.info/api/abaco/eatc_dona_headers?eatc-code={eatc_code}"
response = requests.get(url)
return response.json()[1]