I'm running the following code on Node.js with Express 4.7.2
express.get('/test1',function(req, res) {
var ttt = false;
if (req.query.username === undefined) ttt = true;
res.json({query: ttt});
});
I call the URL:
{{protocol}}://{{server}}/test1?username=1
And I get the result:
{query: true}
Which shows req.query.username
is indeed undefined
What am I missing? How come the query param is not passed in?