Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Commit

Permalink
docs: update nested router example (#10115)
Browse files Browse the repository at this point in the history
  • Loading branch information
FenLiaoYu authored and danielroe committed Jan 21, 2023
1 parent 6c948d3 commit 5f84a6c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/content/1.docs/2.guide/2.directory-structure/1.server.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5f84a6c

Please sign in to comment.