hono-ban
Version:
HTTP-friendly error objects for Hono, inspired by Boom
24 lines (23 loc) • 608 B
TypeScript
/**
* Error handling middleware
* @module hono-ban/middleware/ban-middleware
*/
import type { MiddlewareHandler } from "hono";
import type { BanMiddlewareOptions } from "../types";
/**
* Create error handling middleware
* @param options - Middleware configuration options
*
* @example
* // Simple usage
* app.use(ban());
*
* @example
* // Advanced usage
* app.use(ban({
* formatter: customFormatter,
* sanitize: ['password', 'token'],
* includeStackTrace: process.env.NODE_ENV !== 'production'
* }));
*/
export declare function ban(options?: BanMiddlewareOptions): MiddlewareHandler;