I have created a web service using dropwizard application.
-
Through this I am able to create resources package wherein I have created entity for indexing the document, search request, getting doc by id.
-
By hitting the api in postman I get the desired result.
-
For developing the web application I built the front end using ember.js.
-
But when I send request to my application I am getting CORS policy exception.
- When I am sending request through postman to
http://localhost:9090
(9090
is the port number of my ApplicationConnector) then it is respnding to the request. - Now when I send request from origin
http://localhost:4200
(4200
is the default port number for ember.js) tohttp://localhost:9090
it is giving error :
- When I am sending request through postman to
Access to XMLHttpRequest at http://localhost:9090/{indexName}/{id} >from origin http://localhost:4200 has been blocked by CORS policy: Response to preflight request doesn't pass access control check:
No 'Access->Control-Allow-Origin' header is present on the requested resource.
So can someone please explain how to resolve this issue and if there is any other way apart from enabling CORS in Dropwizard ?
Aucun commentaire:
Enregistrer un commentaire