J
J
JordanBelford2021-01-28 13:31:54
Node.js
JordanBelford, 2021-01-28 13:31:54

How to pass many parameters in a route?

Hello!
Below is an example, but the problem is, and if you need to pass 10 parameters, how to do it right?

app.put('/test/:id/:text', async (req, res) => {
  
})

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
turbolizard, 2021-01-28
@JordanBelford

If you have 10 parameters in a route, it means that you are doing something wrong. Perhaps it is worth passing some part of the parameters in the request body. And yes, if you have 10 parameters that make up the path, all 10 must be specified.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question