0

My node server uses one and only one route: GET /I/want/title This route expects a list of websites addresses in query string format e.g.

    /web/=http://bing.com
    /web/?address=http://yahoo.com

This works ok, so how to use one route for both or more?

    yahoo&bing

Only one route will be used for both single and multiple requests.

  • Possible duplicate of [How to pass an array within a query string?](https://stackoverflow.com/questions/6243051/how-to-pass-an-array-within-a-query-string) – George Jan 21 '19 at 15:47

1 Answers1

0

You could use, for example:

/I/want/title/?address=bing.com,www.yahoo.com

And then easily split parameter to array:

var addressesArray = address.split(',');
MarcoS
  • 17,323
  • 24
  • 96
  • 174