N
Nuxt7mo ago
Eric

Middleware for OUTGOIN requests ?

from what I understand, middlewares run on every route change. But I would like a piece of code to run every time a request is made to the file storage that live on different domains. I would like to intercept to request made by img tags to set the authorization header... Is there a way to create that ?
3 Replies
manniL
manniL7mo ago
Try a nitro API endpoint that calls the endpoint
Eric
EricOP7mo ago
thanks for you response ! but I don't see what you mean 😅
manniL
manniL7mo ago
so, instead of calling the domain directly, set up a nitro api endpoint which you can call That endpoint then calls the domain with the right headers for example if you think about $fetch requests though, use an interceptor
Want results from more Discord servers?
Add your server