Production Hono patterns — zValidator hooks, typed generics, error handling, middleware composition, testing, and multi-runtime deployment
87
80%
Does it follow best practices?
Impact
98%
2.57xAverage score across 5 eval scenarios
Passed
No known issues
Build a simple notes API using Hono and TypeScript, deployed as a Cloudflare Worker with KV storage for persistence.
Endpoints:
POST /api/notes -- create a note (fields: title, content, tags array optional)GET /api/notes -- list all notes (returns metadata only: id, title, tags, createdAt)GET /api/notes/:id -- get a full note including contentPUT /api/notes/:id -- replace a noteDELETE /api/notes/:id -- delete a noteThe Worker has a KV namespace binding called NOTES_KV. Use it for storage:
notes:index key with an array of note metadataBusiness rules:
Produce:
src/index.ts -- Cloudflare Worker entry pointsrc/app.ts -- Hono applicationsrc/routes/notes.ts -- note route handlerswrangler.toml -- Cloudflare Worker configuration with KV bindingpackage.json -- with dependencies (no need to install)You may create additional files as needed.