2

How can I get GET parameters in an express route?

# requested path: /foo/1234?x=9 router.get('/foo/:id', function(req,res){ console.info(req.params.id); // 1234 - my url segment ?????; // 9 }); 
0

1 Answer 1

1

You could get that by using req.query

http://expressjs.com/api.html#req

Just add this line

var x = req.query.x; 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.