angularjs - Cross-Origin Request Blocked - NodeJs -


i'm having issue mean stack app on aws - windows. so, i've placed port 3000 node server listen, , iis using port 80 default.

then when start node server listen, , fire app want data angular through node. i'm trying this:

$http.get('http://localhost:3000/get_data').success(function(response) { // response }); 

this reproduce error in console:

enter image description here

this blocker me, appreciate if can point me right way.

i'm interested know why happening, why i'm getting cors port different default (80)?

thanks

there nice node.js package called cors. can make use of library in following way

var cors = require('cors') app.options('/get_data', cors()); app.route('/get_data').get(cors(), dooperation()); 

Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -