mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 05:35:13 +00:00
docs: update nested router example (#10115)
This commit is contained in:
parent
f0c894060c
commit
8892cccb06
@ -201,14 +201,14 @@ export default defineNuxtConfig({
|
||||
|
||||
### Using a Nested Router
|
||||
|
||||
```ts [server/api/hello.ts]
|
||||
import { createRouter } from 'h3'
|
||||
```ts [server/api/hello/[...slug].ts]
|
||||
import { createRouter, defineEventHandler, useBase } from 'h3'
|
||||
|
||||
const router = createRouter()
|
||||
|
||||
router.get('/', () => 'Hello World')
|
||||
router.get('/test', defineEventHandler(() => 'Hello World'))
|
||||
|
||||
export default router
|
||||
export default useBase('/api/hello', router.handler)
|
||||
```
|
||||
|
||||
### Sending Streams (Experimental)
|
||||
|
Loading…
Reference in New Issue
Block a user