Skip to content

Commit

Permalink
docs(powered-by): add JSDoc (#3520)
Browse files Browse the repository at this point in the history
  • Loading branch information
yusukebe authored Oct 15, 2024
1 parent 89a0ac1 commit 90833d2
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/middleware/powered-by/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 90833d2

Please sign in to comment.