New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refine route lookup mechanisms #887
Comments
yeh, is it suppose to return an array? cause I think it's returning an object right now... the documentation has me believe it should return an array.
same goes for match()
But actual object being returned, not an array. (array-like object?)
|
yeah it's an array-like object right now but I definitely want to tweak this portion quite a bit |
plus I think the docs haven't been updated, it's an array of Route objects |
What about just exposing Or... what about something as simple as: |
lookup / match are too opinionated. they're stored as a map of { VERB: [ROUTES] } internally so if we want to make them removable people will have to go about it that way, though a single array would be nicer for some things. I guess first task is to determine what use-cases there are for exposing them at all |
Single array would be nice for some things, but usually, you know the VERB with which the route is associated, and you're only interested in those routes. Use case for me is: I have a app.get('*', ...); route setup prior to a few other routes. The purpose here is to capture the request "no matter what." The route middleware essentially checks to see if the user is logged in. If so, it calls |
the current app.lookup.get() etc stuff is kinda more "cute" than anything else, perhaps just a simple app.routes.filter(fn) and that's it
The text was updated successfully, but these errors were encountered: