Skip to content

Commit 0ef28ab

Browse files
authored
fix : changes according to new nextjs doc & fix typo
1 parent e978c1c commit 0ef28ab

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/integrations/nextjs.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ head:
1818

1919
With Nextjs App Router, we can run Elysia on Nextjs route.
2020

21-
1. Create **[...slugs]/route.ts** inside app router
21+
1. Create **[[...slugs]]/route.ts** inside app router
2222
2. In **route.ts**, create or import an existing Elysia server
2323
3. Export the handler with the name of method you want to expose
2424

2525
```typescript
26-
// apps/[...slugs]/routes.ts
26+
// app/[[...slugs]]/route.ts
2727
const app = new Elysia()
2828
.get('/', () => 'hello Next')
2929
.post('/', ({ body }) => body, {
@@ -50,7 +50,7 @@ If you place an Elysia server not in the root directory of the app router, you n
5050
For example, if you place Elysia server in **apps/api/[...slugs]/routes.ts**, you need to annotate prefix as **/api** to Elysia server.
5151

5252
```typescript
53-
// apps/api/[...slugs]/routes.ts
53+
// apps/api/[[...slugs]]/route.ts
5454
const app = new Elysia({ prefix: '/api' })
5555
.get('/', () => 'hi')
5656
.post('/', ({ body }) => body, {

0 commit comments

Comments
 (0)