feat(medusa): Add health endpoint for all running modes of medusa (#10737)

This commit is contained in:
Stevche Radevski
2024-12-26 13:53:12 +08:00
committed by GitHub
parent 699bb6dc24
commit c8f9938865
2 changed files with 6 additions and 4 deletions
+6
View File
@@ -138,6 +138,12 @@ async function start(args: {
}
const serverActivity = logger.activity(`Creating server`)
// Register a health check endpoint. Ideally this also checks the readiness of the service, rather than just returning a static response.
app.get("/health", (_, res) => {
res.status(200).send("OK")
})
const server = GracefulShutdownServer.create(
http_.listen(port, host).on("listening", () => {
logger.success(