Closed elimence closed 8 years ago
This has nothing to do with docs ^^ it's a feature request, can you move the issue to trails repo please ?
Also having a Router
object is not possible, or more something like:
Router
.post( '/user', 'UserCtl.create')
.put( '/user', 'auth.isAuthenticated', 'UserCtl.update')
Because middleware are in classes and need to be instantiate, Trails do it during launch process so you can't call them before.
Also this notation give less configuration possibilities:
At the end this notation is more complicated... I'll rather use the current notation :) but I'm 100% for the subrouting feature ! I'm closing this one please open a new one into trails repo and reference this issue for history. Thanks!
Currently, route definitions look as follows:
Which is a it cumbersome, especially if you need to define lots of routes. Would be nice to be able to have a more succinct syntax, perhaps something like so?
Just an example, but you get my point I hope.
Also nested routes would be really nice, mostly for convenience, so stuff like this can be done:
Also just an example, but I hope the general idea comes through. That should be all, I'll add updates if anything else comes to mind :)