I get into Node.JS and want to have flexibility in the routing engine. I want to control the mapping between incoming URLs and what methods are running.
I would really like to configure placeholders in a route suitable for automatic parameter analysis. Sort of
{"routes": [ {'route': {'url': '/path/to/resource/[id]'}, "handler": idHandler()}, {'route': {'url': '/path/to/foo/[category]/bar'}, "handler": fooHandler(), {'route': {'url': '/path/to/resource/'}, "handler": defaultHandler()}} ]};
source share