Skip to content
Myr

Fixed example

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Yusuke Wada · committed by Yusuke Wada · parent 6190e81 · Browse files · 5 files+7 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

5 files+7 added−6 removed

  • tests:+1 added−0 removed
  • other:+6 added−6 removed

5 files+7 added−6 removed

modified:example/basic/index.js+3 added-3 removed
modified:src/middleware/defaultFilter.js+1 added-1 removed
modified:src/hono.js+1 added-1 removed
modified:src/hono.test.js+1 added
156 unmodified lines
157 if (c.res.status === 404) {158 c.res = new fetch.Response('Custom 404 Not Found', { status: 404 })159 }160 }161162 expect(() => {163 app.use('*', customNotFound)164 }).toThrow(TypeError)165 })
1 unmodified line
modified:README.md+1 added-1 removed
121 unmodified lines
122}123124const addHeader = async (c, next) => {125 next()126 c.res.headers.add('x-message', 'This is middleware!')126 await c.res.headers.add('x-message', 'This is middleware!')127}128129app.use('*', logger)130app.use('/message/*', addHeader)
73 unmodified lines