Add ElysiaJS integration and update homepage

This commit is contained in:
James Blair 2026-05-08 18:39:08 +12:00
parent 3197d2fb1b
commit 666b2d0e0d
Signed by: james
SSH key fingerprint: SHA256:hsDR3ENI2ZMgh+CNb+0PrFsj29DI007R+BMKUVGi6zQ
12 changed files with 112 additions and 100 deletions

4
server/index.ts Normal file
View file

@ -0,0 +1,4 @@
import Elysia, { t } from "elysia";
import { health } from "./modules/health";
export const app = new Elysia({ prefix: "/api" }).use(health);

View file

@ -0,0 +1,10 @@
import { Elysia } from "elysia";
import { HealthModel } from "./model";
import { Health } from "./service";
export const health = new Elysia({ prefix: "/health" }).get(
"/",
() => Health.check(),
{ response: HealthModel.checkResponse },
);

View file

@ -0,0 +1,11 @@
import { t, type UnwrapSchema } from "elysia";
export const HealthModel = {
checkResponse: t.Object({
status: t.Literal("ok"),
}),
} as const;
export type HealthModel = {
[k in keyof typeof HealthModel]: UnwrapSchema<(typeof HealthModel)[k]>;
};

View file

@ -0,0 +1,9 @@
import { HealthModel } from "./model";
export abstract class Health {
static async check() {
return {
status: "ok",
} satisfies HealthModel["checkResponse"];
}
}