Skip to content

Instantly share code, notes, and snippets.

@santiago
Created January 12, 2012 00:25
Show Gist options
  • Save santiago/1597685 to your computer and use it in GitHub Desktop.
Save santiago/1597685 to your computer and use it in GitHub Desktop.
// Express
app.post('/location', checkLocation, function(req, res){
server.getService('geo', function(geo) {
var location= [req.lat,req.lon];
geo.delegate(req.key, location, function(data) {
res.send(data, 200); // ---> data is NOT undefined
});
});
});
// Superagent
var data= {key:'testapikey',lat:5,lon:-74};
request
.post("http://localhost:8080/location")
.send(data)
.end(function(call) {
var res= call.res;
res.statusCode.should.equal(200);
console.log(res.body); // --> undefined
done();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment