@router.get("/")
async def products_get(request: Request):
url = "https://YOUR_DOMAIN/products"
async with aiohttp.ClientSession() as client:
resp = await client.get(url)
text = await resp.text()
return Response(text, status_code=resp.status, headers=resp.headers)
@router.get("/{product_id}")
async def product_get(product_id: int, request: Request):
url = f"https://YOUR_DOMAIN/products/{product_id}"
resp = await aiohttp.ClientSession().get(url)
text = await resp.text()
return Response(text, status_code=resp.status, headers=resp.headers)