From 90833d24670a8a679112fbcae0b8b0a09683333d Mon Sep 17 00:00:00 2001 From: Yusuke Wada Date: Tue, 15 Oct 2024 17:50:12 +0900 Subject: [PATCH] docs(powered-by): add JSDoc (#3520) --- src/middleware/powered-by/index.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/middleware/powered-by/index.ts b/src/middleware/powered-by/index.ts index 66004cb2..fb9a608a 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()