D
D
Danil2016-07-29 09:50:29
Node.js
Danil, 2016-07-29 09:50:29

Why is query not getting the correct value?

I make a query like:

http://127.0.0.1:3000/additionalitems/advertising/list/query?page=2

This handles a route like this:
additional.get('/advertising/list/:query', function(req, res) {
    console.loog(req.query) // Выводит {query: 'query'}
})

And you need to output page=2. In other routes it works fine, but here I missed something. Can you tell me where to look?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim, 2016-07-29
@Veneomin

req.params.query

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question