Created
January 12, 2012 00:25
-
-
Save santiago/1597685 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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