Hi, when having multiple projects opened in terminal I wanted a way to prevent starting another server then the one I’m testing right now.
So what I do is add two lines in mix.exs, in the aliases section:
"phx.server": "",
"phx.MyApp": "phx.server",
In this way if I type mix phx.server
nothing will happen, and if I type mix phx.MyApp
in the wrong terminal also nothing will happen.
Also this is a nice way to personalize your app
Do you have any thoughts on this?
Later edit:
I was wrong above, you need to create a new task for this to work, and put the default to do some dummy action:
defmodule Mix.Tasks.Startit do
use Mix.Task
def run([] = params) do
Mix.Tasks.Phx.Server.run([])
end
end
In mix.exs:
"phx.server": "help",
"phx.MyApp": "startit"