Next.js Discord

Discord Forum

How to protect API route?

Unanswered
Kryp Arnold posted this in #help-forum
Open in Discord
Hello guys, one of my api route will be public and i dont want people to abuse it i mean they can just write a simple javascript and limit the bandwidth i think and i will publish it on vercel is this a problem?

5 Replies

European sprat
You could do some kind of rate limiting based on the IP that you get in headers
is there any tutorial on it?
or any library
European sprat
I don't know any
Cuban Martin
checkout this tutorial
https://www.youtube.com/watch?v=h4-2K7nFf7s&t=1567s

He configures a rate limiter at 15:51