Currently routing takes a naive express way approach.
First registered first served. Because we are registering by file listing our routing is defined by that order.
So we have no way to control / know which of the following routes will be executed:
/*
/api
or:
/api/todo/:id
/api/todo/list
i see two ways:
adding a 'priority' number and sort by that
or:
[ ] make express routing testable
[x] define a subset of valid path features (path params, wildcards at the end)
[x] maybe test for unreachable routes
[x] write a simple algorithm which determines the most specific route for conflicts and controls the order of the registration
Currently routing takes a naive express way approach. First registered first served. Because we are registering by file listing our routing is defined by that order.
So we have no way to control / know which of the following routes will be executed: /* /api or: /api/todo/:id /api/todo/list
i see two ways:
or: