3

I'm struggling with routing in Express. This works:

app.get('/customers/bar/:bar/buzz/:buzz', customers.foo);

i.e. requests like this match (return 200 code):

curl -is http://localhost:3000/customers/bar/blah/buzz/blah -H 'accept: text/plain'

but how do I change my app.get(…) to accept an array of parameters for bar e.g. matching a form that would have inputs like this:

<input type="text" name="bar[]" value="test1">
<input type="text" name="bar[]" value="test2">
<input type="text" name="bar[]" value="test3">

I can't see anything in the documentation that demonstrates how this would work. Thanks.

ale
  • 11,636
  • 27
  • 92
  • 149

0 Answers0