From e3dac30eaa36e86e452d34e6dfee36de33d2feb8 Mon Sep 17 00:00:00 2001 From: ngc2207 Date: Fri, 31 Jan 2025 16:37:28 +0800 Subject: [PATCH] feat(rpc): create type-safe client with AppType --- src/lib/rpc.ts | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 src/lib/rpc.ts diff --git a/src/lib/rpc.ts b/src/lib/rpc.ts new file mode 100644 index 0000000..c77dc07 --- /dev/null +++ b/src/lib/rpc.ts @@ -0,0 +1,4 @@ +import { hc } from "hono/client"; +import { AppType } from "@/app/api/[[...route]]/route"; + +export const client = hc(process.env.NEXT_PUBLIC_APP_URL!);