Public
Like
hono-rpc-zod-starter
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Viewing readonly version of main branch: v1View latest version
Minimal Hono RPC starter example
The main.tsx module is the main entrypoint and defines all routes for the Hono server.
This module exports the AppType type based on the routes for the client.tsx module to use.
The server HTML response includes a <script> that imports the client.tsx module.
The client.tsx module imports the AppType type along with hc from hono/client
to create the client instance.
This module demonstrats fetching all cats from the API, adding a new cat, and refetching the results.
This example DOES NOT include validation. See Hono RPC Zod Starter for an example with validation.