Skip to content

Instantly share code, notes, and snippets.

@z4nr34l
Last active August 6, 2024 11:37
Show Gist options
  • Save z4nr34l/c02bdc44493e26b8f0c807ff8dfd8ee8 to your computer and use it in GitHub Desktop.
Save z4nr34l/c02bdc44493e26b8f0c807ff8dfd8ee8 to your computer and use it in GitHub Desktop.
next-easy-middlewares multipath middleware chain
import { createMiddleware } from '@rescale/nemo';
import { internalMiddleware } from '@/app/(platform)/(personal)/_middleware';
const middlewares = {
'/(home|settings){/:path}?': internalMiddleware,
};
export const middleware = createMiddleware(
middlewares as never,
);
export const config = {
matcher: ['/(home|settings)(.*)'],
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment