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
Kuroro4mo 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 Neves4mo ago
yeah, it works My question is more if it's good practice to add it.