V
V
Vearodev2020-06-20 00:05:50
Node.js
Vearodev, 2020-06-20 00:05:50

Is it possible to somehow pass nested get parameters?

Is it possible somehow to pass nested get parameters and then process them in express ?

{
  id: 1,
  params: {
    param1: 1,
    params2: 2
  }
}


How to implement this?
router.get("/products", async (req, res) => {
  console.log(req.query.params.param1)
})

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir, 2020-06-20
@HistoryART

In get, it is passed through a string in the url:

mysite.com/products?id=123

D
Dima Pautov, 2020-06-20
@bootd

https://github.com/ljharb/qs

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question