How can I pass an unknown number of params to NodeJS routes, and save them to an array?:
http://127.0.0.1:3000/param1/param2/param3...
I thought about doing:
app.get('/*', myHandler);
And just tokenize the string, but there should be a better way.
It looks like you are using express routing in NodeJS. If so, you might want to experiment with the regular expressions. Like the following will give you the full path (/vararg/) in req.params[0] but there may be a better way:
So if I do a get on localhost:3000/vararg/foo/bar/gar it will send:
Or localhost:3000/vararg/foo will produce:
And then you can split the parameter into the other parts.