diff --git a/packages/nitro/src/server/middleware.ts b/packages/nitro/src/server/middleware.ts index 1bd25ebba9..a43efd945b 100644 --- a/packages/nitro/src/server/middleware.ts +++ b/packages/nitro/src/server/middleware.ts @@ -31,7 +31,7 @@ function filesToMiddleware (files: string[], baseDir: string, basePath: string, handle } }) - .sort((a, b) => a.route.localeCompare(b.route)) + .sort((a, b) => b.route.localeCompare(a.route)) .map(m => ({ ...m, ...overrides })) }