# Deploy Hono

Deploy a Hono app on Pilvia App as it is — Hono's app is already the fetch handler the platform runs, and c.env is the platform's env.

[Hono](https://hono.dev) runs on Pilvia App unchanged. A Hono app has a
`fetch(request, env)` method, which is exactly the
[shape the platform runs](/reference/runtime.md), so `export default app` is
the whole integration. The platform's `env` arrives as Hono's `c.env`, and
its `ctx` as `c.executionCtx`, so `c.executionCtx.waitUntil(promise)`
finishes [work after the response](/reference/runtime.md#work-after-the-response).

Tested with Hono 4.13 on 2026-11-20.

```ts title="src/index.ts"
import { Hono } from "hono";

type Env = { Bindings: { kv: any; user: any } };
const app = new Hono<Env>();

app.get("/", (c) => c.html("<h1>Hello from Hono</h1>"));
app.get("/api/time", (c) => c.json({ now: new Date().toISOString() }));
app.get("/posts/:slug", (c) => c.text(`post: ${c.req.param("slug")}`));

app.post("/guestbook", async (c) => {
  const { name } = await c.req.parseBody();
  if (!name) return c.text("name required", 400);
  const list = (await c.env.kv.get("guestbook", "json")) ?? [];
  await c.env.kv.put("guestbook", [String(name), ...list].slice(0, 20));
  return c.redirect("/guestbook", 303);
});

export default app;
```

```json title="pilvia.app.json"
{
  "name": "my-api",
  "auth": "public",
  "kv": true,
  "entry": "src/index.ts"
}
```

```sh
pilvia app deploy
```

`pilvia app deploy` bundles the entry with bun, TypeScript included. There
is no separate build step.

## Notes

- **Static files**: declare `"assets": "public"` in the manifest instead of
  Hono's `serveStatic`. The host serves those files before your app runs, with
  [strong ETags](/hosting/caching.md), and a request for one never starts an
  isolate.
- **`c.env`** carries what the manifest grants:
  [`env.kv` and `env.cache`](/hosting/kv.md), [`env.user`](/auth/overview.md) and
  the [data bindings](/data/overview.md).
- **Smaller pieces**: if you only need a few endpoints beside a static site,
  [server functions](/hosting/server-functions.md) do it without a framework.

## What was tested

An HTML page formatting a date with `Intl` in `fi-FI`, a JSON route, a route
parameter, Hono's own 404, and a form POST read with `parseBody` that writes
to `env.kv` and redirects with a 303. The bundle was 55 KB.
