Explorar o código

fix: I forgored it out

Sv443 hai 4 meses
pai
achega
d175972af3
Modificáronse 2 ficheiros con 6 adicións e 3 borrados
  1. 1 1
      package.json
  2. 5 2
      src/routes/index.ts

+ 1 - 1
package.json

@@ -11,7 +11,7 @@
     "build-www": "cd www && pnpm run build",
     "dev-all": "concurrently \"pnpm dev\" \"pnpm dev-www\"",
     "lint": "eslint . && tsc --noEmit",
-    "test": "start-server-and-test start http://127.0.0.1:8074 jest"
+    "test": "start-server-and-test start http://127.0.0.1:8074/v2/health jest"
   },
   "repository": {
     "type": "git",

+ 5 - 2
src/routes/index.ts

@@ -25,9 +25,12 @@ export function initRouter(app: Application) {
   // redirect to docs page
   router.get("/", (_req, res) => redirectToDocs(res));
 
-  // mount router
-  app.use(`/v${verMajor}`, router);
+  // healthcheck
+  router.get("/health", (_req, res) => res.status(200).send("Hello, World!"));
 
   // redirect to docs page
   app.get("/docs", (_req, res) => redirectToDocs(res));
+
+  // mount router
+  app.use(`/v${verMajor}`, router);
 }