This will work if your route looks like this: localhost:8888/p?tagid=1234
var tagId = req.query.tagid;
console.log(tagId); // outputs: 1234
console.log(req.query.tagid); // outputs: 1234
Otherwise use the following code if your route looks like this: localhost:8888/p/1234
var tagId = req.params.tagid;
console.log(tagId); // outputs: 1234
console.log(req.params.tagid); // outputs: 1234