-1

How to come up this error,

XMLHttpRequest cannot load http://samples.openweathermap.org/data/2.5/forecast?appid=bXXXXa1&q=London,us. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access.

The application is building up in AngularJS and server is created through gulp-connect. even not sure, this will fix in AngularJs file or in gulp :(

faisaljanjua
  • 886
  • 2
  • 13
  • 28
  • Possible duplicate of [JSON data not being returned - JQuery AJAX](https://stackoverflow.com/questions/20805481/json-data-not-being-returned-jquery-ajax) – 31piy Jul 07 '17 at 11:35

1 Answers1

0

You need to add this headers on server side

Access-Control-Allow-Headers: Content-Type
Access-Control-Allow-Methods: GET, POST, OPTIONS
Access-Control-Allow-Origin: *
Rohan Kawade
  • 453
  • 5
  • 18