1

I have developed an angular2 project in http://www.demo.aranidhi.in Backend for this application is developed in spring boot which is hosted in http://env-7423163.cloud.cms500.com. If i try to connect front and backend am getting this error

Error image

But this is working in developer machine... I dont know how. I think while exporting to war am missing something. Can you please guide me

Monicka Akilan
  • 1,501
  • 5
  • 19
  • 42
  • Possible duplicate of [Why does my JavaScript get a "No 'Access-Control-Allow-Origin' header is present on the requested resource" error when Postman does not?](https://stackoverflow.com/questions/20035101/why-does-my-javascript-get-a-no-access-control-allow-origin-header-is-present) – Sajeetharan Jan 07 '18 at 05:59
  • Refer this link https://stackoverflow.com/questions/46788969/angular2-spring-boot-allow-cross-origin-on-put/46789290#46789290 – hrdkisback Jan 10 '18 at 10:38

1 Answers1

0

As shown in the error message, this is because you are making cross-origin request.

Before adding cross-origin header to your request from frontend, you can try a simple chrome extension Allow-cross-allow-origin.This should let you make request to the backend.

After confirming that above extension helped you to make your code work, then you can change your request and can add cross-origin headers to it.

Hope this will help!

yugantar kumar
  • 1,982
  • 1
  • 23
  • 33