From 47638ccddd74fb6cbdc01b0645f335e37c346698 Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Mon, 13 Jan 2025 16:07:01 +0100 Subject: [PATCH] fix health check --- api_tests/src/image.spec.ts | 4 ++-- src/api_routes_v4.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api_tests/src/image.spec.ts b/api_tests/src/image.spec.ts index d25ab7f4c..1a686879b 100644 --- a/api_tests/src/image.spec.ts +++ b/api_tests/src/image.spec.ts @@ -41,8 +41,8 @@ afterAll(async () => { }); test("Upload image and delete it", async () => { - const healthz = await fetch(alphaUrl + "/pictrs/healthz"); - expect(healthz.status).toBe(200); + const health = await alpha.imageHealth(); + expect(health.success).toBeTruthy(); // Before running this test, you need to delete all previous images in the DB await deleteAllImages(alpha); diff --git a/src/api_routes_v4.rs b/src/api_routes_v4.rs index 5fbecf7b2..02eb11cd7 100644 --- a/src/api_routes_v4.rs +++ b/src/api_routes_v4.rs @@ -428,8 +428,8 @@ pub fn config(cfg: &mut ServiceConfig, rate_limit: &RateLimitCell) { .route(delete().to(delete_image)), ) .route("/proxy", get().to(image_proxy)) - .route("/{filename}", get().to(get_image)) - .route("/health", get().to(pictrs_health)), + .route("/health", get().to(pictrs_health)) + .route("/{filename}", get().to(get_image)), ), ); }