mirror of
https://github.com/honojs/hono.git
synced 2024-11-24 11:07:29 +01:00
docs(powered-by): add JSDoc (#3520)
This commit is contained in:
parent
89a0ac18ed
commit
90833d2467
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user