Skip to content

Commit 0646284

Browse files
committed
Fix catchall path with pages router
1 parent add87af commit 0646284

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/NextJs.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ In many cases, the admin is only a part of the application. For instance, you ma
112112

113113
This implies the creation of a new page in the Next.js app. Create a new file at the following location:
114114

115-
- **App Router**: `src/app/admin/page.tsx`
116-
- **Pages Router**: `src/pages/admin/index.tsx`
115+
- App Router: `src/app/admin/page.tsx`
116+
- Pages Router: `src/pages/admin/index.tsx`
117117

118118
No matter which system you choose, the file should contains the same code:
119119

@@ -159,10 +159,10 @@ SUPABASE_SERVICE_ROLE="MY_SERVICE_ROLE_KEY"
159159

160160
**Tip**: This example uses the **service role key** here and not the anonymous role. This allows mutations without dealing with authorization. **You shouldn't do this in production**, but use the [Supabase authorization](https://supabase.com/docs/guides/auth) feature instead.
161161

162-
Create [a "catch-all" API route](https://nextjs.org/docs/api-routes/dynamic-api-routes#optional-catch-all-api-routes) in the Next.js app by adding a new file at the following location:
162+
Create [a "catch-all" API route](https://nextjs.org/docs/app/building-your-application/routing/dynamic-routes#catch-all-segmentss) in the Next.js app by adding a new file at the following location:
163163

164-
- **App Router**: `src/app/api/admin/page.ts`
165-
- **Pages Router**: `src/pages/api/admin/[[...slug]].ts`
164+
- App Router: `src/app/api/admin/[...slug]/page.ts`
165+
- Pages Router: `src/pages/api/admin/[[...slug]].ts`
166166

167167
This API route redirects all calls from the react-admin app to the Supabase CRUD API:
168168

0 commit comments

Comments
 (0)