mirror of
https://github.com/C4illin/ConvertX.git
synced 2026-03-03 02:27:00 +00:00
feat: add healthcheck endpoint (#431)
This commit is contained in:
@@ -18,6 +18,7 @@ import { results } from "./pages/results";
|
||||
import { root } from "./pages/root";
|
||||
import { upload } from "./pages/upload";
|
||||
import { user } from "./pages/user";
|
||||
import { healthcheck } from "./pages/healthcheck";
|
||||
|
||||
mkdir("./data", { recursive: true }).catch(console.error);
|
||||
|
||||
@@ -48,6 +49,7 @@ const app = new Elysia({
|
||||
.use(deleteFile)
|
||||
.use(listConverters)
|
||||
.use(chooseConverter)
|
||||
.use(healthcheck)
|
||||
.onError(({ error }) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
12
src/pages/healthcheck.tsx
Normal file
12
src/pages/healthcheck.tsx
Normal file
@@ -0,0 +1,12 @@
|
||||
import Elysia from "elysia";
|
||||
import { userService } from "./user";
|
||||
|
||||
export const healthcheck = new Elysia().use(userService).get(
|
||||
"/healthcheck",
|
||||
() => {
|
||||
return { status: "ok" };
|
||||
},
|
||||
{
|
||||
auth: false,
|
||||
},
|
||||
);
|
||||
Reference in New Issue
Block a user