diff --git a/docs/content/1.docs/2.guide/2.directory-structure/1.server.md b/docs/content/1.docs/2.guide/2.directory-structure/1.server.md index 4f2508640b..9e4c8a8733 100644 --- a/docs/content/1.docs/2.guide/2.directory-structure/1.server.md +++ b/docs/content/1.docs/2.guide/2.directory-structure/1.server.md @@ -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)