fix(hello): use `MiddlewareHandler`

pull/20/head
Yusuke Wada 2023-01-13 07:57:14 +09:00
parent afe48fdb03
commit cfd961df6b
2 changed files with 4 additions and 4 deletions

View File

@ -25,9 +25,9 @@
}, },
"homepage": "https://github.com/honojs/middleware", "homepage": "https://github.com/honojs/middleware",
"peerDependencies": { "peerDependencies": {
"hono": "^2.6.2" "hono": "^2.7.2"
}, },
"devDependencies": { "devDependencies": {
"hono": "^2.6.2" "hono": "^2.7.2"
} }
} }

View File

@ -1,6 +1,6 @@
import type { Handler } from 'hono' import type { MiddlewareHandler } from 'hono'
export const hello = (message: string = 'Hello!'): Handler => { export const hello = (message: string = 'Hello!'): MiddlewareHandler => {
return async (c, next) => { return async (c, next) => {
await next() await next()
c.res.headers.append('X-Message', message) c.res.headers.append('X-Message', message)