Answer the question
In order to leave comments, you need to log in
How to use cors npm package?
I make a request to google through angular $http, it gives an error
XMLHttpRequest cannot load http://maps.googleapis.com/maps/api/geocode/json?address=%D0%94%D0%BE%D1%81&sensor=false. Request header field Authorization is not allowed by Access-Control-Allow-Headers in preflight response.
app.use('cors());
Answer the question
In order to leave comments, you need to log in
cors
is a middleware for express, a library running on the server, and has nothing to do with angular (running on the client).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question