Skip to content

Commit 80b5565

Browse files
authored
feat: add healthcheck endpoint (#431)
1 parent 32d1c56 commit 80b5565

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { results } from "./pages/results";
1818
import { root } from "./pages/root";
1919
import { upload } from "./pages/upload";
2020
import { user } from "./pages/user";
21+
import { healthcheck } from "./pages/healthcheck";
2122

2223
mkdir("./data", { recursive: true }).catch(console.error);
2324

@@ -48,6 +49,7 @@ const app = new Elysia({
4849
.use(deleteFile)
4950
.use(listConverters)
5051
.use(chooseConverter)
52+
.use(healthcheck)
5153
.onError(({ error }) => {
5254
console.error(error);
5355
});

src/pages/healthcheck.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import Elysia from "elysia";
2+
import { userService } from "./user";
3+
4+
export const healthcheck = new Elysia().use(userService).get(
5+
"/healthcheck",
6+
() => {
7+
return { status: "ok" };
8+
},
9+
{
10+
auth: false,
11+
},
12+
);

0 commit comments

Comments
 (0)