Skip to content
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

An easier way to determine what handler will handle some request #17

Open
emhoracek opened this issue Sep 5, 2018 · 0 comments
Open

Comments

@emhoracek
Copy link
Member

emhoracek commented Sep 5, 2018

In my codebase, we have many routes. One thing that I like about Fn is that I can put routes where ever it makes sense it me -- to compare to Rails, it's not all stuck in routes.rb.

So we have a main routing function routes in Site that says that all routes starting with "/admin" are routed through adminRoutes in Handle.Admin. Other routes are handled by userRoutes or apiRoutes or other routing functions, and not all of them have as straightforward signals as "starts with foo".

People who are new to the codebase find it confusing that they can't immediately find a handler by looking at the main routing function, and sometimes you have to go two or more functions deep to finally find the handler for a given request!

I think it would be neat if there was a tool of some sort (like Rails' rake routes) to see all the routes and handlers at once, or to construct a simple version of a request and ask "what would handle this?".

Would probably require some static analysis?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant