Server routes.React pages.No API in between.

A route file holds a Hono handler and the React page it renders. Plain links and forms change pages in place: no API to write, no client-side router to keep in sync.

Read the docs
import { back, defineHandler, render } from 'fondu'

// GET /todos
export const loader = defineHandler(async (c) =>
  render(c, Todos, { items: await db.todos.all() }),
)

// POST /todos, from the form
export const action = defineHandler.withValidator({ body: todo })(
  async (c, { body }) => {
    await db.todos.add(body)
    return back(c)
  },
)

// the page: all the browser gets of this file
export default function Todos({ items }: { items: Todo[] }) {
  return (
    <>
      <ul>
        {items.map((t) => (
          <li key={t.id}>{t.text}</li>
        ))}
      </ul>
      <form method="post">
        <input name="text" />
        <button>Add</button>
      </form>
    </>
  )
}

Start with one routeand one page.

The quick start creates an app for your runtime and walks through its first page.