See all project's routes with a simple command
Is your feature request related to a problem? Please describe. It is always useful to have a global and concise view of all routes available on your project.
Describe the solution you'd like It would be nice to be able to see the routes in you app's default router + the routes generated from Ash framework in a single view. Something like
mix phx.route
But which would show Ash generated routes in addition to the default router's "hand-written" routes.
Describe alternatives you've considered For now we can use the command described in the AshJsonApi doc:
AshJsonApi.Resource.Info.routes/1
source = https://hexdocs.pm/ash_json_api/getting-started-with-json-api.html#run-your-api
Express the feature either with a change to resource syntax, or with a change to the resource interface
I don’t know.
Additional context
I have nothing more to say.
Great idea :)
@zachdaniel I'd like to tackle this one, just need a few pointers: I reckon it should be similar to phx.routes task but it gets all domains (which function should I use for that) and calls the function above on them, extract routes and print similar to phx.routes.
Not sure how to get domains. Also, an argument --domain Domain would scope to that domain; or maybe the argument would be required to get the domain? wdyt?
Yep! You could take a look at how the task is implemented in AshAuthentication as well. That should be a basis for this :)
We could then add an alias for mix phx.routes that calls this task after calling phx.routes 🎉