Courses / Node.js
8. Query params (req.query)
Access parsed query string parameters available on req.query in Express apps.
1 min read Chapter 8 of 48
JavaScript / Express
Query params (req.query)
req.query is where Express gives you the parsed key/value pairs from the URL query string (the ?foo=1&bar=hi part).
"I need values from the URL like ?page=2 without parsing the string myself."
req.query is an object Express attaches to the request containing parsed query-string parameters as strings (or arrays) from the URL.
"I need values from the URL like ?page=2 without parsing the string myself."
req.query is an object Express attaches to the request containing parsed query-string parameters as strings (or arrays) from the URL.