/Wiki/sources/honojs__hono/2026/https-hono-dev-llms-full-txt-server-9e72bd1625cc-server-s0047-c0000.md
Server - hono-docs
Server Source evidence: /Sources/raw/honojs hono/honojs hono.md Canonical citation: https://hono.dev/llms full.txt server Summary All you need to do on the s...
Server
Source evidence: /Sources/raw/honojshono/honojshono.md Canonical citation: https://hono.dev/llms-full.txt#server
Summary
All you need to do on the server side is to write a validator and create a variable route. The following example uses Zod Validator. ```ts{1} const route = app.po...
Content
All you need to do on the server side is to write a validator and create a variable route. The following example uses Zod Validator.
const route = app.post(
'/posts',
zValidator(
'form',
z.object({
title: z.string(),
body: z.string(),
})
),
(c) => {
// ...
return c.json(
{
ok: true,
message: 'Created!',
},
201
)
}
)Then, export the type to share the API spec with the Client.
export type AppType = typeof route