Hono
The same notes API on Hono: one app, served by Node.js or by AWS Lambda.
- native Hono middlewares (
secureHeaders()) applied to the Dotpress routes, and a native Hono route (/health); - two entries:
node.tswith@hono/node-server,lambda.tswith the main entry of the adapter, which has no Node.js server; - tests in memory with
adapter.fetch()(WebRequestandResponse), over HTTP, and on simulated API Gateway events.
Source: examples/hono.
Run it
The routes
The same routes as the Fastify example, unchanged: they do not depend on the server.
The app
The app takes its adapter as a parameter: the options of the adapter are shared, the adapter itself comes from the entry.
Two entries
npm run build:lambda bundles the handler into dist/lambda.mjs: about 115 kB gzipped, Hono and Zod included, the smallest of the adapters. See Choosing an adapter.