I am using NuxtJS 2, I deployed my app on Vercel and everything has been working fine. The things changed when I decided to add serverMiddleware, I created a api
folder, I added the following to the nuxt.config.js file:
serverMiddleware: [{
path: /api ,
handler: ~/api/newsletter.ts
}],
And everything works just fine locally. As expected. I released it to my preview environment, added the corresponding environment variables, but when I try to do an api call I get the following error: POST http://localhost:3000/api/subscribe net::ERR_BLOCKED_BY_CLIENT in the release environment.
I am aware it says local host. I tried adding a vercel.json with the corresponding configuration, but it won t work in Vercel. How do I get to use api call without it being denied by the client?