mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-26 07:32:01 +00:00
docs: update legacy server examples (#19797)
This commit is contained in:
parent
9e67e57efd
commit
65f40d0443
@ -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}
|
||||
|
Loading…
Reference in New Issue
Block a user