Dig Dig - 1 year ago 101
Node.js Question

API queries in Nodejs/Express

why doesn't this work?


but this works :


how to make the former work with the
(Question mark)

str str
Answer Source

See https://expressjs.com/en/guide/routing.html

Query strings are not part of the route path.

If you want to use the query string, use req.query:

app.get('/search', function (req, res) {
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download