I am very new to web development and am trying to create a website using client/server model. From what I understand, the front-end (client-side) calls URLs specified on the server to get information. So if my website was www.example.com, when the user clicks a button on my site, a request will be sent to www.example.com/api/buttonClicked, and my server will then run the logic and return a response correct?
But simply by using developer tools on Chrome, anyone can see the URL the request is being sent to (www.example.com/api/buttonClicked) and the data being sent. How can i prevent someone from calling this URL? Or even if they did call it, how can i prevent my server from giving them a response?
If it helps, I am using Flask to build the server