diff options
| author | Mohamed Bassem <me@mbassem.com> | 2025-07-02 00:13:33 +0000 |
|---|---|---|
| committer | Mohamed Bassem <me@mbassem.com> | 2025-07-04 16:27:29 +0000 |
| commit | f144f1bcc21e20f29381aa5d69ed3f822dbaec9a (patch) | |
| tree | 60e82a5b2164821f719b64e89b21f913ed55a93e /packages/api | |
| parent | f5e737bf9645271f8525070f9ba6de1f476fafd9 (diff) | |
| download | karakeep-f144f1bcc21e20f29381aa5d69ed3f822dbaec9a.tar.zst | |
refactor: Move the health endpoint to hono as well
Diffstat (limited to 'packages/api')
| -rw-r--r-- | packages/api/index.ts | 2 | ||||
| -rw-r--r-- | packages/api/routes/health.ts | 16 |
2 files changed, 18 insertions, 0 deletions
diff --git a/packages/api/index.ts b/packages/api/index.ts index ab7cdbe2..2eb22d8f 100644 --- a/packages/api/index.ts +++ b/packages/api/index.ts @@ -7,6 +7,7 @@ import { Context } from "@karakeep/trpc"; import trpcAdapter from "./middlewares/trpcAdapter"; import assets from "./routes/assets"; import bookmarks from "./routes/bookmarks"; +import health from "./routes/health"; import highlights from "./routes/highlights"; import lists from "./routes/lists"; import publicRoute from "./routes/public"; @@ -44,6 +45,7 @@ const app = new Hono<{ await next(); }) .use(trpcAdapter) + .route("/health", health) .route("/trpc", trpc) .route("/v1", v1) .route("/assets", assets) diff --git a/packages/api/routes/health.ts b/packages/api/routes/health.ts new file mode 100644 index 00000000..64c2d45b --- /dev/null +++ b/packages/api/routes/health.ts @@ -0,0 +1,16 @@ +import { Hono } from "hono"; + +import { Context } from "@karakeep/trpc"; + +const health = new Hono<{ + Variables: { + ctx: Context; + }; +}>().get("/", (c) => { + return c.json({ + status: "ok", + message: "Web app is working", + }); +}); + +export default health; |
