I'm developing a back-end RESTfull app with ExpressJS(Node). And reading with angularJS. I got this error on chrome.
**
XMLHttpRequest cannot load http://local.dev:3000/api. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://local.dev:63359' is therefore not allowed access.
**
Note : ExpressJS api working on Postman app. Postman app is successfully get data.
This is my code ANGULARJS
$http.post("http://local.dev:3000/api",{
"username" :'JJ',
"email" : '[email protected]'
}).then(function(mes){
console.log(mes);
});
EXPRESSJS
router.get('/', function(req, res) {
res.json({ message: 'hooray! welcome to our api!' });
});
Thanks in advance.