HBForge/Examples
25 examples · 1 npm dependency · 5 runtimes

Every Hono example, ported to HBForge.

All 25 examples from hono.dev/examples rewritten with HBForge's WebApp + sibling modules. Each has its own deep-dive page with full code, an explanation, runtime notes, related modules, and a link to the Hono original.

25/25examples
1install
0adapter packages
5runtimes
Applications

Applications

7 examples
01
Web API
A minimal REST API: list, get, create, update, delete. State is in-memory; swap for forge/data to back it with Postgres/SQLite.
forge/server
02
Proxy
Forward every request under /api/* to another origin, preserving method, headers, query string and body.
forge/server
03
File upload
Accept multipart/form-data uploads, read the file as a Web Standards File object, persist to disk.
forge/server
04
Bind a reverse proxy
When deployed behind nginx / Caddy / Cloudflare, reconstruct the original URL from X-Forwarded-Proto and X-Forwarded-Host.
forge/server
05
Error handling in Validator
Validate request bodies with HBForge's built-in schema builder — Zod-like fluent API, zero dependencies.
forge/server
06
Grouping routes for RPC
Each sub-app has its own router and middleware. app.route() composes them into a single tree without runtime overhead.
forge/server
07
CBOR
Read and write application/cbor. c.body() accepts a Uint8Array directly so you can return raw binary without encoding tricks.
forge/server
Docs / OpenAPI

Docs / OpenAPI

5 examples
08
Zod OpenAPI
HBForge's schema builder is Zod-compatible by API — generateOpenAPI31() walks the router and produces a full spec from it.
forge/serverforge/schema
09
Hono OpenAPI
One function call generates the spec by reflecting on the router. No DSL, no annotations.
forge/server
10
Swagger UI
swaggerUI({ url }) returns a complete HTML page wired to the Swagger UI CDN — drop in one route.
forge/server
11
Scalar
Use Scalar's beautiful API reference instead of Swagger UI. The html`` tagged template auto-escapes interpolation; raw() opts out.
forge/server
12
Hono Docs Generator
Bake the OpenAPI spec to disk during build. Plug into a docs deploy pipeline for git-tracked, diffable API contracts.
forge/server
Integrations

Integrations

13 examples
13
Cloudflare Durable Objects
Stateful primitives on the edge. c.env exposes the binding; the Durable Object class exports next to the app.
forge/server
14
Cloudflare Queue
Enqueue work over HTTP, consume in the same Worker via a queue() handler.
forge/server
15
Cloudflare Testing
Because app.fetch takes a Request and returns a Response, the entire app is testable in-process with zero infrastructure.
forge/server
16
Remix
Mount Remix's universal request handler under a wildcard. c.req.raw is the underlying Request — pass it through.
forge/server
17
htmx
Server-rendered HTML, no client framework, no build step.
forge/server
18
Stripe Webhook
Verify the stripe-signature header against the raw body. c.req.text() caches the body, so later .json() calls don't throw.
forge/server
19
Prisma on Cloudflare
Use Prisma's edge client, or skip the dep entirely with forge/data. Same connection pooling, query builder, migrations — built in.
forge/serverforge/data
20
Better Auth
forge/auth ships Password, JWT, SessionManager, OAuth2 PKCE, TOTP, WebAuthn, RBAC, ApiKeyAuth, BackupCodes, AdaptiveMFA — 34 APIs,.
forge/serverforge/auth
21
Better Auth on Cloudflare
Same forge/auth module, exported as a CF Workers entrypoint. JWT.sign and Password.
forge/serverforge/auth
22
Pylon (GraphQL)
Pylon is Hono's GraphQL adapter. forge/server ships GraphQLEngine directly: schema + resolvers + DataLoader, no separate package.
forge/server
23
Stytch Authentication
Forward to Stytch's API. Or use forge/auth's MagicLink, TOTP, BackupCodes if you'd rather not depend on a vendor.
forge/server
24
Auth.js
Mount Auth.js's universal handler under a wildcard. c.req.raw is the underlying Request; Auth.
forge/server
25
Apitally (Monitoring)
Built-in webLogger() covers basics; forge/trace gives OpenTelemetry-compatible distributed tracing.
forge/serverforge/trace

One package. Every example.

Every example above runs on the same @hyperbridge/forge install. No adapters, no second package for the Node listener, no per-runtime forks.