I am working on a full-stack Next.js application. There I have these API endpoints
-api/foo
-api/bar
-api/apoo
Bad guys shouldn't be able to loop the API call and take the server down. I think the technical term for that is rate limiting.
Since I am not using Nginx or any other server, I think rate-limiting should be handled by the vercel configuration.
How do I achieve this using vercel and Next.js?
Also I would like to know if there is a way to set different different limits to endpoints as well? Like api/foo two requests for a minute, api/bar 10 requests for minute.