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 runs on Pilvia App unchanged. A Hono app has a
fetch(request, env) method, which is exactly the
shape the platform runs, 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.
Tested with Hono 4.13 on 2026-11-20.
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;{
"name": "my-api",
"auth": "public",
"kv": true,
"entry": "src/index.ts"
}pilvia app deploypilvia 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'sserveStatic. The host serves those files before your app runs, with strong ETags, and a request for one never starts an isolate. c.envcarries what the manifest grants:env.kvandenv.cache,env.userand the data bindings.- Smaller pieces: if you only need a few endpoints beside a static site, server functions 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.