If I use the barebones echo server demo for restify, it works correctly. But if I make a few changes shown below, it behaves different than I would expect:
var restify = require('restify');
function respond(req, res, next) {
res.send(req.params); //NOTE: should echo back all params
}
var server = restify.createServer();
server.get('/hello/', respond); //NOTE: parameter :name removed
server.listen(8080, function() {
console.log('%s listening at %s', server.name, server.url);
});
What I've done is removed the name param from the URL and echoed all parameters in response function. calling:
http://localhost:8080/hello
returns
{}
but so does:
http://localhost:8080/hello?foo=bar
Why don't I see foo:bar in the response?