DEV Community

Luis Gustavo Caciatori
Luis Gustavo Caciatori

Posted on

TIL - Phoenix Router 1.7 --Info trick

For Phoenix 1.7 you can pass an option --info for a path and the mix command will return to you the controller, action and file name with line for that router.

mix phx.routes --info http://localhost:4000/status
Enter fullscreen mode Exit fullscreen mode

results

$ mix phx.routes --info http://localhost:4000/status
Module: ExampleWeb.StatusController
Function: :status
/Users/lab/example/lib/example_web/controllers/status_controller.ex:7
Enter fullscreen mode Exit fullscreen mode

More info https://hexdocs.pm/phoenix/1.7.7/Mix.Tasks.Phx.Routes.html

Commit for this change on Phoenix repository
https://github.com/phoenixframework/phoenix/commits/v1.7.7/lib/mix/tasks/phx.routes.ex

Top comments (0)