Public
Like
hono-rpc-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 miliseconds.
main.tsx
https://jxnblk--04c964b842db11f0977f76b3cceeab13.web.val.run
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.