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:
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
Post a Comment