© 2026 Hedgehog Software, LLC
$post: (args?: {}, options?: ClientRequestOptions)
args?
args: { json: { name: string } }
import { Hono } from 'hono' import { zValidator as baseZodValidator } from '@hono/zod-validator'; import z from 'zod'; let state = {} const app = new Hono() .post("/set", baseZodValidator("json", z.object({ name: z.string() })), (c) => { const partialState = c.req.valid("json") state = { ...state, ...partialState } return c.json(state) }) .get('/', (c) => { return c.json(state) }) Deno.serve(app.fetch) export type AppType = typeof app
const globalStateClient = hc<AppType>("localhost:8080") globalStateClient.set.$post()