When running the external api in local host it works fine, But trying with another host on my network I’m not gettting anything. Give a solution.
var Api = new Restivus({
useDefaultAuth: false,
prettyJson: true,
enableCors: true,
defaultHeaders: {
‘Access-Control-Allow-Origin’: ‘’,
‘Access-Control-Allow-Headers’: ‘Origin, X-Requested-With, Content-Type, Accept, Z-Key, x-user-id,x-auth-token’,
‘Access-Control-Allow-Methods’: ‘GET, POST, PUT, DELETE, OPTIONS’,
‘Content-Type’: ‘application/json’
},
defaultOptionsEndpoint: function() {
this.response.writeHead(201, {
‘Access-Control-Allow-Origin’: '’,
‘Access-Control-Allow-Headers’: ‘Origin, X-Requested-With, Content-Type, Accept, Z-Key’,
‘Content-Type’: ‘application/json’,
‘Access-Control-Allow-Methods’: ‘GET, POST, PUT, DELETE, OPTIONS’,
});
}
});
Api.addRoute(‘articles/’, {authRequired: false}, {
get: function () {
console.log(‘executed’)
return Meteor.users.find().fetch();
}
my api: http://192.168.1.153:3000/api/articles
I just hit the api in my crome browser. Any help would be appreciated