{
  "id": 3466865,
  "title": "Nuxt server routes with Hono RPC-style type safety, no rewrite",
  "url": "https://urgent.news/2026/08/26/nuxt-server-routes-with-hono-rpc-style-type-safety-no-rewrite",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-08-26T08:35:32.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/yoshinoriishii/nuxt-server-routes-with-hono-rpc-style-type-safety-no-rewrite-205k"
  },
  "original_language": "en",
  "account": "Nuxt server routes using Hono RPC-style type safety are now available without the need for rewriting existing code. Instead of having to manage validation and response types separately, Nuxt Endpoints allows developers to define a single contract for each route. This contract includes the validator, client types, and an OpenAPI document, making it easier to keep track of all the details. The route's path, method, and location in server/api remain unchanged, and Nitro's routing is unaffected. Hono RPC is familiar to developers already using it, and the client code still infers the return type from the handler, just as it does with typed $fetch. If the route does not require explicit response schemas, the client types will still be inferred from the handler's return value, similar to the behavior of typed $fetch. This approach offers a gradual transition to typed endpoints, allowing developers to start with no schema and later add response schemas as needed.",
  "summary": "Here is a Nuxt route written the way the docs recommend, and the code that calls it: // server/api/users/[id].get.ts import { z } from ' zod ' export default defineEventHandler ( async ( event ) => { const { id } = await getValidatedRouterParams ( event , z . object ({ id : z . coerce . number (), }). parse ) const user = await findUser ( id ) if ( ! user ) throw createError ({ statusCode : 404 ,…",
  "key_points": [
    "Nuxt server routes now support Hono RPC-style type safety without code rewrite.",
    "Developers define a single contract per route with validator, client types, and OpenAPI document.",
    "Route path, method, and location unchanged; Nitro routing unaffected."
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}