From 9a2460342d312efd8a9b09f2a8918323634c49b5 Mon Sep 17 00:00:00 2001 From: Robert Kenny Date: Sun, 14 Jan 2024 14:58:59 +0000 Subject: [PATCH] Adds a simple healthcheck endpoint for the items service This change follows https://github.com/wellcomecollection/catalogue-api/pull/736, and adds an HTTP healthcheck to the items API to ensure the scala service has started before it is registered healthy at the NLB and starts serving requests. --- items/src/main/scala/weco/api/items/ItemsApi.scala | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/items/src/main/scala/weco/api/items/ItemsApi.scala b/items/src/main/scala/weco/api/items/ItemsApi.scala index d14df2f267..4ffd946f6d 100644 --- a/items/src/main/scala/weco/api/items/ItemsApi.scala +++ b/items/src/main/scala/weco/api/items/ItemsApi.scala @@ -36,6 +36,14 @@ class ItemsApi( case id => notFound(s"Work not found for identifier $id") } + }, + pathPrefix("management") { + concat( + path("healthcheck") { + get { + complete("message" -> "ok") + } + }) } ) }