File tree 1 file changed +7
-10
lines changed
1 file changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -38,20 +38,17 @@ function createNitroApp (): NitroApp {
38
38
39
39
for ( const h of handlers ) {
40
40
let handler = h . lazy ? lazyEventHandler ( h . handler ) : h . handler
41
-
42
- // Wrap matching handlers for caching route options
43
- const routeRules = getRouteRulesForPath ( h . route . replace ( / : \w + | \* \* / g, '_' ) )
44
- if ( routeRules . cache ) {
45
- handler = cachedEventHandler ( handler , {
46
- group : 'nitro/routes' ,
47
- ...routeRules . cache
48
- } )
49
- }
50
-
51
41
if ( h . middleware || ! h . route ) {
52
42
const middlewareBase = ( config . app . baseURL + ( h . route || '/' ) ) . replace ( / \/ + / g, '/' )
53
43
h3App . use ( middlewareBase , handler )
54
44
} else {
45
+ const routeRules = getRouteRulesForPath ( h . route . replace ( / : \w + | \* \* / g, '_' ) )
46
+ if ( routeRules . cache ) {
47
+ handler = cachedEventHandler ( handler , {
48
+ group : 'nitro/routes' ,
49
+ ...routeRules . cache
50
+ } )
51
+ }
55
52
router . use ( h . route , handler , h . method )
56
53
}
57
54
}
You can’t perform that action at this time.
0 commit comments