10
I am creating a Restful API with Nodejs and express and in it, I am using Cors to "control" requests.
In the browser works, if I make a request to this API by the console of the site here of Stackoverflow, I can not use, it is blocked, if I go in my domain in which I released access in this way:
app.get('/product/:id', cors({ origin: "https://www.meusite.com.br" })
I succeed when using the API.
However, the question is, if I go from anywhere using Postman, Insomnia or derivatives, I can take advantage of any API feature.
Why does this happen?
I get it... Is there anything similar to "Cors" for any request from anywhere? Or would you have to validate it manually?
– Lucas de Carvalho
are you saying the server validation? if this is the link helps a lot: https://enable-cors.org/server.html
– Ricardo Pontual