Skip to content

Commit b574520

Browse files
committed
middleware matcher routes
1 parent 49b8a41 commit b574520

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

src/adapter/build/routing.ts

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -330,19 +330,16 @@ export async function generateRoutingRules(
330330
// server actions name meta routes
331331

332332
...(hasMiddleware
333-
? [
334-
{
333+
? (nextAdapterContext.outputs.middleware!.config.matchers?.map((matcher, index) => {
334+
return {
335335
// originally: middleware route
336-
description: 'Middleware',
337-
// match: {
338-
// path: 'test',
339-
// },
340-
// match: {
341-
// path: 'wat',
342-
// },
336+
description: `Middleware (matcher #${index})`,
337+
match: {
338+
path: matcher.sourceRegex,
339+
},
343340
apply: { type: 'middleware' },
344-
} as const,
345-
]
341+
} as const
342+
}) ?? [])
346343
: []),
347344

348345
// ...convertedRewrites.beforeFiles,

0 commit comments

Comments
 (0)