From c5ea2f1065173a5a76af416e0152a0260ba40052 Mon Sep 17 00:00:00 2001 From: Bram Kelchtermans Date: Tue, 28 Jan 2025 14:49:42 +0100 Subject: [PATCH] add healthcheck --- Dockers/puppeteer-api/main.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Dockers/puppeteer-api/main.py b/Dockers/puppeteer-api/main.py index 6c40470..fc3a7f2 100644 --- a/Dockers/puppeteer-api/main.py +++ b/Dockers/puppeteer-api/main.py @@ -16,6 +16,10 @@ async def wait_for_network_idle(page): """Wait until no network requests are in flight""" await page.waitForNetworkIdle(idleTime=500, timeout=30000) +@app.head("/") +async def health_check(): + return {"status": "ok"} + @app.get("/") async def visit_url(url: str, x_api_key: Optional[str] = Header(None)): # Validate API key