diff --git a/src/middleware/powered-by/index.ts b/src/middleware/powered-by/index.ts index 66004cb2b..fb9a608a5 100644 --- a/src/middleware/powered-by/index.ts +++ b/src/middleware/powered-by/index.ts @@ -5,9 +5,28 @@ import type { MiddlewareHandler } from '../../types' type PoweredByOptions = { + /** + * The value for X-Powered-By header. + * @default Hono + */ serverName?: string } +/** + * Powered By Middleware for Hono. + * + * @param options - The options for the Powered By Middleware. + * @returns {MiddlewareHandler} The middleware handler function. + * + * @example + * ```ts + * import { poweredBy } from 'hono/powered-by' + * + * const app = new Hono() + * + * app.use(poweredBy()) // With options: poweredBy({ serverName: "My Server" }) + * ``` + */ export const poweredBy = (options?: PoweredByOptions): MiddlewareHandler => { return async function poweredBy(c, next) { await next()