From b2a9094819b603ffee2cf731e37f85496800b95c Mon Sep 17 00:00:00 2001 From: Adrian Bonpin Date: Sat, 25 Apr 2026 13:17:29 +0800 Subject: [PATCH] feat(api): add isomorphic Eden Treaty client for end-to-end type safety --- lib/eden.ts | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 lib/eden.ts diff --git a/lib/eden.ts b/lib/eden.ts new file mode 100644 index 0000000..39435ac --- /dev/null +++ b/lib/eden.ts @@ -0,0 +1,7 @@ +import { treaty } from "@elysia/eden" +import { app } from "@/app/api/[[...slugs]]/route" + +export const api = + typeof process !== "undefined" + ? treaty(app).api + : treaty("localhost:3000").api