File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -18,12 +18,12 @@ head:
18
18
19
19
With Nextjs App Router, we can run Elysia on Nextjs route.
20
20
21
- 1 . Create ** [ ...slugs] /route.ts** inside app router
21
+ 1 . Create ** [[ ...slugs] ] /route.ts** inside app router
22
22
2 . In ** route.ts** , create or import an existing Elysia server
23
23
3 . Export the handler with the name of method you want to expose
24
24
25
25
``` typescript
26
- // apps/[ ...slugs]/routes .ts
26
+ // app/[[ ...slugs]]/route .ts
27
27
const app = new Elysia ()
28
28
.get (' /' , () => ' hello Next' )
29
29
.post (' /' , ({ body }) => body , {
@@ -50,7 +50,7 @@ If you place an Elysia server not in the root directory of the app router, you n
50
50
For example, if you place Elysia server in ** apps/api/[ ...slugs] /routes.ts** , you need to annotate prefix as ** /api** to Elysia server.
51
51
52
52
``` typescript
53
- // apps/api/[...slugs]/routes .ts
53
+ // apps/api/[[ ...slugs]]/route .ts
54
54
const app = new Elysia ({ prefix: ' /api' })
55
55
.get (' /' , () => ' hi' )
56
56
.post (' /' , ({ body }) => body , {
You can’t perform that action at this time.
0 commit comments