mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-18 17:35:57 +00:00
docs: use defineEventHandler()
to avoid warnings (#18557)
Avoid the warning: > [h3] Implicit event handler conversion is deprecated. Use `eventHandler()` or `fromNodeMiddleware()` to define event handlers.
This commit is contained in:
parent
5c7715813d
commit
64b835c707
@ -83,10 +83,10 @@ In brief, `useFetch` receives a URL and gets that data, whereas `useAsyncData` m
|
||||
|
||||
```ts [server/api/count.ts]
|
||||
let counter = 0
|
||||
export default () => {
|
||||
export default defineEventHandler(() => {
|
||||
counter++
|
||||
return JSON.stringify(counter)
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
```vue [app.vue]
|
||||
|
Loading…
Reference in New Issue
Block a user