ColtHands
ColtHands
NNuxt
Created by ColtHands on 3/16/2025 in #❓・help
How do you add a middleware to nitro.routeRules in defineNuxtConfig?
I'm using routeRules with proxy. I've tried doing appMiddleware but having that middleware does nothing, wether it lives in /middleware or /server/middleware. Having that middleare mymiddleware in /server/middleware folder does not generate types for appMiddleware values, it does generate types if it exists in /middleware folder only. So the answer here does not apply. On top of that having .global. middleware seems to work for everything but the routeRules. I'm using nuxt 3.15.4. Maybe there's a general guide on how to add a middleware to routeRules? Is having proxy somehow blocks middleware from applying?
5 replies