11Kas
How to protect my API endpoints
I have an API written in nodejs and I have a frontendapp written in angularjs. I want my API to be called only through my frontendapp and not from any other source.
e.g. I have an endpoint called myhost.com/posts/id and when the method is delete it deletes the posts. I dont want an attacker to access this end point and deletes my posts. How can I prevent it?