server middleware added to nuxt config

Hi all The docs say "Nuxt will automatically read in any file in the ~/server/middleware to create server middleware for your project." My question is, should I still added to nuxt.config like this?
server: {
middleware: ['auth.ts'],
},
server: {
middleware: ['auth.ts'],
},
Thanks
2 Replies
Kuroro
Kuroro9mo ago
Hi, I think there's no needed anymore You just have to try to remove it and add some logs into your middleware, to see if it's actually working, no?
Victor Neves
Victor NevesOP9mo ago
yeah, it works My question is more if it's good practice to add it.
Want results from more Discord servers?
Add your server