TalksAWS re:Invent 2025 - Supercharge Lambda with Hono: The lightweight web framework (CNS374)
AWS re:Invent 2025 - Supercharge Lambda with Hono: The lightweight web framework (CNS374)
Supercharge Lambda with Hono: The Lightweight Web Framework
Introduction to Hono
Hono is a TypeScript-first web framework that brings a familiar Express-like developer experience to AWS Lambda.
It provides a straightforward request-response syntax, allowing developers to quickly build web applications and APIs on Lambda.
Hono's key benefits include runtime abstraction, a rich ecosystem, and a lightweight footprint.
Why Hono for AWS Lambda?
Traditional approaches to deploying web apps on Lambda, such as using API Gateway and multiple single-purpose functions, can feel foreign to developers coming from traditional web frameworks.
The "Lambda pattern" of a single function handling routing and multiple functionalities, often paired with Lambda Function URLs, simplifies the setup but still requires dealing with unfamiliar Lambda handler and event shapes.
Hono addresses these frictions by providing an Express-like developer experience, making it easier for web developers to build and deploy applications on Lambda.
Hono's Runtime Abstraction
Hono's runtime abstraction allows a single Hono app to run across multiple environments, including Node.js, Deno, and AWS Lambda.
To run a Hono app on Lambda, developers only need to add two lines of code to import the Hono Lambda package and wrap the Hono app as a Lambda handler.
This runtime abstraction enables developers to write their application logic once and deploy it to different environments without the need to rewrite or fork the code.
Hono's Ecosystem and Production-Ready Features
Hono's ecosystem includes a wide range of plugins and middleware that cover common production needs, such as:
Hono OpenAPI: Generates an OpenAPI schema from Zod-based input validation.
Hono Client (Hono RPC): Provides a typed HTTP client generated from the server-side code, enabling end-to-end type safety.
Authentication plugins: Integrates with various authentication providers.
Hono MCP: Allows developers to easily build an MCP (Message Queuing Telemetry Transport) server with Hono.
These plugins help developers quickly address common requirements without having to build everything from scratch.
Hono's Developer Experience and Deployment
The recommended project structure for Hono on Lambda includes three small files:
app.ts: Defines the domain logic and exposes the Hono app.
handler.ts: Imports the Hono app and exports it as a Lambda handler.
index.ts: Imports the Hono app and runs it as a local Node.js server for development.
This setup allows developers to easily debug the Hono app locally and then deploy the handler.ts file to Lambda.
Comparison with AWS Lambda Web Adapter
The main difference between Hono and the AWS Lambda Web Adapter is the prioritization of developer experience and new application development.
Hono is recommended for developers who want to prioritize a TypeScript-first, Express-like developer experience and build new applications on Lambda.
The AWS Lambda Web Adapter is more suitable for migrating existing web applications running on other languages or frameworks to Lambda.
Key Takeaways
Hono provides a familiar, Express-like developer experience for building web applications and APIs on AWS Lambda.
Its runtime abstraction allows a single Hono app to run across multiple environments, including Node.js, Deno, and AWS Lambda.
Hono's rich ecosystem of plugins and middleware covers common production needs, such as OpenAPI generation, typed HTTP clients, and authentication, helping developers build production-ready applications quickly.
The recommended project structure simplifies local development and deployment to Lambda, making it easier for web developers to get started with Hono on Lambda.
Hono is well-suited for developers who want to prioritize a TypeScript-first, Express-like developer experience when building new applications on AWS Lambda.
These cookies are used to collect information about how you interact with this website and allow us to remember you. We use this information to improve and customize your browsing experience, as well as for analytics.
If you decline, your information won’t be tracked when you visit this website. A single cookie will be used in your browser to remember your preference.