diff --git a/docs/2.guide/2.directory-structure/1.server.md b/docs/2.guide/2.directory-structure/1.server.md index d53346e237..36927a446f 100644 --- a/docs/2.guide/2.directory-structure/1.server.md +++ b/docs/2.guide/2.directory-structure/1.server.md @@ -266,9 +266,9 @@ export default defineEventHandler((event) => { ### Return a Legacy Handler or Middleware ```ts [server/api/legacy.ts] -export default (req, res) => { +export default fromNodeMiddleware((req, res) => { res.end('Legacy handler') -} +}) ``` ::alert{type=warning} @@ -276,10 +276,10 @@ Legacy support is possible using [unjs/h3](https://github.com/unjs/h3), but it i :: ```ts [server/middleware/legacy.ts] -export default (req, res, next) => { +export default fromNodeMiddleware((req, res, next) => { console.log('Legacy middleware') next() -} +}) ``` ::alert{type=warning}