I am trying to deploy a simple web app consisting front end reactjs and backend python for the api routes
I want to allow api reqeusts by reactjs only, that will be deployed on the same server
In other words I do not want others to be able to e.g use postman to call the api
Is this possible? I do not wish to add authentication at this point as it's a really small project
One option is to have flask listen on 127.0.0.1 and then only local users will be able to connect to the api. Another option, you can bind the flask app on a unix socket file (instead of a ip:port) and set the file permissions for that socket so that only the users you want will be able to access it.
python flask limit connection to requests from local network only?