honojs-middleware/packages/hello/src/index.ts

9 lines
221 B
TypeScript
Raw Normal View History

2023-01-13 06:57:14 +08:00
import type { MiddlewareHandler } from 'hono'
2023-01-13 06:57:14 +08:00
export const hello = (message: string = 'Hello!'): MiddlewareHandler => {
return async (c, next) => {
await next()
c.res.headers.append('X-Message', message)
}
}