Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
test('should be able to retrieve an attraction', function(done){
rest.post(base+'/attraction', {data:attraction}).on('success', function(data){
rest.get(base+'/attraction/'+data.id)
.on('success', function(data){
assert(data.name===attraction.name);
assert(data.description===attraction.description);
done();
})
.on('error', function() {
assert(false, 'Did you remember to alias api.meadowlark to 127.0.0.1 in your /etc/hosts file?');
});
});
});
function installService(res,url) {
rest.post(durl+':'+dport + pathinstall+"/"+url).
on('complete', function (data, response) {
console.log(data);
console.log(response.statusCode);
res.send(data);
});
}
return new Promise((resolve, reject) => {
restler.post(this.getRemoteUrl() + '/hashbrown/api/content/tree?token=' + this.settings.token, {
headers: headers,
data: json
})
.on('success', (data, response) => {
resolve(data);
})
.on('fail', (data, response) => {
reject(data);
});
});
}
ast.ExecRuleStatementNode.prototype.build = function ExecRuleStatementNodeBuild(indent, indentChar, obj, options) {
var deferred = q.defer();
var ruleEngineApi = app.get('ruleEngine');
var api = ruleEngineApi + '?name=' + this.name;
restler.post(api, {
data: obj.instance.__data
}).on('complete', function handleResponse(data, response) {
deferred.resolve(data);
});
return deferred.promise;
};
Slack.prototype.__rpc = function(method, data, cb) {
var self = this;
data.token = self.config.slack.token;
rest.post('https://slack.com/api/'+method, {
data: data
}).on('complete', function(data) {
cb(null, data);
});
};