feat(api): set up Elysia server with health check on Next.js catch-all route
This commit is contained in:
@@ -0,0 +1,15 @@
|
|||||||
|
import { Elysia } from "elysia"
|
||||||
|
import { healthRoutes } from "@/lib/api/health"
|
||||||
|
|
||||||
|
const app = new Elysia({ prefix: "/api" })
|
||||||
|
.use(healthRoutes)
|
||||||
|
.get("/", () => ({
|
||||||
|
name: "DeckyVault API",
|
||||||
|
version: "2026.0.1",
|
||||||
|
}))
|
||||||
|
|
||||||
|
export const GET = app.fetch
|
||||||
|
export const POST = app.fetch
|
||||||
|
export const PUT = app.fetch
|
||||||
|
export const DELETE = app.fetch
|
||||||
|
export const PATCH = app.fetch
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
import { Elysia } from "elysia"
|
||||||
|
|
||||||
|
export const healthRoutes = new Elysia({ prefix: "/health" }).get(
|
||||||
|
"/",
|
||||||
|
() => ({
|
||||||
|
status: "ok",
|
||||||
|
timestamp: new Date().toISOString(),
|
||||||
|
service: "deckyvault-api",
|
||||||
|
}),
|
||||||
|
)
|
||||||
Reference in New Issue
Block a user