Friday, 26 May 2017

CORS issue with NodeJS server to Tomcat server

I have backend web services written using Java Spring and deployed on the tomcat server say IP address XXX.XXX.XXX.XXX on port 8443 with HTTPS protocol.

And I have the front-end application written using React JS with create-react-app scaffold which consumes the rest api services exposed by the JAVA spring application using jQuery AJAX. I've built the js files and bundled, and served via a simple node server. This node server is hosted on say, IP address YYY.YYY.YYY.YYY on port 8443.

From the browser through the frontend, I'm trying to hit the POST call and it fails on pre-flight operation with request method as OPTIONS.

Tried servicing YYY.YYY.YYY.YYY through HTTPS protocol and face the same issue.

The spring application has the CORS filtering enabled and accepts requests from any domain.

Need an expert advise who had come across the same issue and how you fixed.



via Vimalraj Selvam

No comments:

Post a Comment