I am running Web REST API on Swagger, Sail JS, when I am trying to access through Angular UI,. I have set the required headers in the UI and as well as enabled in sailjs > config/cors.js file with below values.
allRoutes: true,
origin: '*',
credentials: true,
From the UI application, I am setting below headers before sending any request.
this.headers = new Headers({ 'Content-Type': 'application/json', 'Accept': 'q=0.8;application/json;q=0.9' });
this.headers.set('Access-Control-Allow-Origin' , '*');
this.headers.set('Access-Control-Allow-Methods', 'GET,POST,PUT,HEAD,DELETE,OPTIONS');
this.headers.set('Access-Control-Allow-Headers', 'origin, content-type, accept');
this.headers.append('Access-Control-Allow-Credentials', 'true');
this.headers.append('Access-Control-Max-Age' , '86400');
But I am not able to get the response from Sail JS, can you please let me know if I am missing anything or do I need enable any other settings on the SailJS config.
I am running Web REST API on Swagger, Sail JS, when I am trying to access through Angular UI,. I have set the required headers in the UI and as well as enabled in sailjs > config/cors.js file with below values.
allRoutes: true, origin: '*', credentials: true,
From the UI application, I am setting below headers before sending any request. this.headers = new Headers({ 'Content-Type': 'application/json', 'Accept': 'q=0.8;application/json;q=0.9' }); this.headers.set('Access-Control-Allow-Origin' , '*'); this.headers.set('Access-Control-Allow-Methods', 'GET,POST,PUT,HEAD,DELETE,OPTIONS'); this.headers.set('Access-Control-Allow-Headers', 'origin, content-type, accept'); this.headers.append('Access-Control-Allow-Credentials', 'true'); this.headers.append('Access-Control-Max-Age' , '86400');
But I am not able to get the response from Sail JS, can you please let me know if I am missing anything or do I need enable any other settings on the SailJS config.
Please do the needful to resolve this issue.