You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Update matcher regex in middleware.ts / proxy.ts
#397
/*
* Match all paths except for:
* 1. API route handlers
* 2. /_next (Next.js internals)
* 3. /sitecore/api (Sitecore API routes)
* 4. /- (Sitecore media)
* 5. /healthz (Health check)
* 7. all root files inside /public
*/
matcher: [
'/',
'/((?!api/|sitemap|robots|_next/|healthz|sitecore/api/|-/|favicon.ico|sc_logo.svg).*)',
],
It hasn't been updated since JSS days, and since then we don't get /sitecore/api (Sitecore API routes) or /- (Sitecore media) being proxied. Also the 7. comment looks a bit misleading.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Description
The current matcher
content-sdk/packages/create-content-sdk-app/src/templates/nextjs/src/proxy.ts
Line 76 in af0b249
It hasn't been updated since JSS days, and since then we don't get /sitecore/api (Sitecore API routes) or /- (Sitecore media) being proxied. Also the 7. comment looks a bit misleading.
I also notice that most next.js examples e.g https://github.com/vercel/turborepo/blob/main/apps/docs/proxy.ts#L71C6-L71C51 tend to have _next/static|_next/image.
Additional information
No response
All reactions