I have two separate serverless projects on Vercel: a 100% client-side rendered frontend and an API. Due to different domains, I'm experiencing CORS preflight requests that i would like to avoid, and I also don't want to expose my API's address to the frontend users.
I'm planning to use Vercel's rewrite feature to route API requests through my frontend domain. My main concern is billing: Will I be charged twice for bandwidth and execution time when using this rewrite configuration?
It wasn't very clear to me if the rewrite would increase bandwidth costs. Can the middleware identify that both projects are within Vercel's infrastructure and waive this cost? Another question, are middleware billings per execution or by time? Is the time counted the full request time or only the rewrite execution time?