From 9e606edc5b02bca5f958ee9feb8b1fa5cb53b2b4 Mon Sep 17 00:00:00 2001 From: Frank Kong <50030060+Zaperex@users.noreply.github.com> Date: Thu, 2 Nov 2023 05:22:36 -0400 Subject: [PATCH] fix(backend): fixed backend routers for images (#691) Co-authored-by: Tomas Kral --- .changeset/dull-kangaroos-nail.md | 5 +++++ packages/backend/src/index.ts | 13 ++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) create mode 100644 .changeset/dull-kangaroos-nail.md diff --git a/.changeset/dull-kangaroos-nail.md b/.changeset/dull-kangaroos-nail.md new file mode 100644 index 0000000000..258374035f --- /dev/null +++ b/.changeset/dull-kangaroos-nail.md @@ -0,0 +1,5 @@ +--- +'backend': patch +--- + +Fixed the ordering of the backend routers so that the `/metrics` and `/healthcheck` endpoints can be accessed in the image when the frontend and backend share the same baseUrl. diff --git a/packages/backend/src/index.ts b/packages/backend/src/index.ts index 00b8cb3d6a..ad230632ff 100644 --- a/packages/backend/src/index.ts +++ b/packages/backend/src/index.ts @@ -248,12 +248,6 @@ async function main() { root: '/api', router: apiRouter, }); - await addRouter({ - name: 'app', - service, - root: '', - router: await app(appEnv), - }); await addRouter({ name: 'healthcheck', service, @@ -269,7 +263,12 @@ async function main() { root: '', router: metricsHandler(), }); - + await addRouter({ + name: 'app', + service, + root: '', + router: await app(appEnv), + }); await service.start().catch(err => { console.log(err); process.exit(1);