docs: add Express-to-Hono migration guide#124
Merged
PAMulligan merged 1 commit intoJun 13, 2026
Conversation
Add docs/migration/from-express.md mapping every common Express pattern to its Hono/Nerva equivalent: app setup and middleware registration, route definition, request/response handling, middleware patterns, error handling, route grouping, static files, and environment/config. Includes an Express to Hono cheat-sheet table, a porting-gotchas checklist, and a section on what Nerva layers on top of Hono (pipeline, agents, skills, templates). Examples are grounded in the generated Node and Cloudflare snippets (Zod-validated config, c.env bindings, app.onError with typed errors, chained Hono sub-apps). Link the guide from the README documentation index. Fixes #20 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
docs/migration/from-express.md— a side-by-side migration guide helping Express.js developers transition to Nerva/Hono. Express is the most common starting point for backend developers evaluating Nerva, so a clear, familiar-pattern → Nerva-pattern mapping directly addresses the #1 question new users have.What's covered
All required topics, each with Express → Hono comparisons:
express()+app.use()→new Hono()+app.use("*", ...), with the npm packages Hono replaces built in)app.get/post/put/patch/delete— near-identical, plus chaining)req.body→await c.req.json(),res.json→return c.json, the full input/output mapping)(req, res, next)→(c, next), before/after split byawait next(), short-circuit by returning, typedc.set/c.getvsreq.user)app.onError, throw vsnext(err),app.notFound)express.Router()→new Hono()+app.route(), group-scoped middleware)express.static→serveStatic, plus the Workers[assets]caveat)process.envvs Workersc.envtrap, centralized through Nerva's Zod-validated config module)Plus:
return, async body, etc.)Grounding
Examples mirror the actual generated snippets (
templates/snippets/nodeandcloudflare): Zod-validatedconfig.ts,c.envbindings on Workers, the real middleware stack,app.onErrorwith typed errors, and chainednew Hono()sub-apps — so the guide stays consistent with what the generator emits.Docs index
Linked from the README documentation table.
CI
All internal links resolve to existing files; external links limited to
hono.dev,hono.dev/docs/api/exception(already used elsewhere in docs), andexpressjs.comto keep lychee link validation green.Fixes #20
🤖 Generated with Claude Code