hono-middleware

Create and compose middleware for Hono web applications.

68|19|Updated Nov 21, 2025
One-click install
npx skills add https://github.com/bobmatnyc/claude-mpm-skills --skill hono-middleware-bobmatnyc
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hono-middleware
Source: https://github.com/bobmatnyc/claude-mpm-skills/tree/main/toolchains/javascript/frameworks/hono/middleware
Command: npx skills add https://github.com/bobmatnyc/claude-mpm-skills --skill hono-middleware-bobmatnyc

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill simplifies the process of adding essential cross-cutting concerns like authentication, logging, and CORS to Hono web applications, making them more robust and secure.

Core Features & Use Cases

  • Onion-style Execution: Understand how middleware executes before and after request handlers.
  • Built-in Middleware: Leverage 25+ pre-built middleware for common tasks (CORS, auth, logging, compression, etc.).
  • Custom Middleware: Create type-safe, reusable middleware functions for specific needs.
  • Use Case: Secure your API endpoints by easily adding JWT authentication and rate limiting using Hono's built-in middleware.

Quick Start

Apply the built-in CORS middleware to all routes in your Hono application.

Frequently Asked Questions about hono-middleware

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add CORS and JWT authentication to a Hono web application?

You can add CORS and JWT authentication to a Hono web application by applying Hono's built-in middleware to your routes. This Skill provides patterns for leveraging these pre-built middleware functions to secure API endpoints and manage cross-cutting concerns efficiently.

What is the execution order of middleware in Hono?

Middleware in Hono follows an onion-style execution model. This means middleware functions execute before and after your main request handlers, allowing you to run setup logic before the response and cleanup or logging logic after the response is generated.

How do I create custom middleware in Hono using TypeScript?

Creating custom middleware in Hono involves writing type-safe, reusable functions that intercept requests. This Skill details patterns for custom middleware creation and passing context variables, ensuring your middleware is fully type-safe within your TypeScript web application.

Does Hono have built-in middleware for rate limiting and compression?

Yes, Hono provides over 25 built-in middleware for common tasks including rate limiting, compression, logging, and security headers. You can leverage these pre-built components directly in your application to manage essential web service requirements without external dependencies.

Can I use Hono middleware to manage security headers and logging for my API?

Yes, Hono middleware is specifically designed to manage cross-cutting concerns like security headers and logging for APIs. By applying the appropriate built-in middleware, you can streamline these essential web service requirements across all your routes.