Dig Dig - 4 months ago 51
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

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) {