What mix task phx.server really do under the hood?
1 Like
Just starts the application in a regular way, but with extra application env variable (serve_endpoints
) which states that the listener must be started
5 Likes
The best way to know it is reading the code.
As you said, phx.server
is a mix task. And mix tasks have a pattern on the file structure, they are always placed in lib/mix/tasks/
.
For phoenix, the file is phoenix/phx.server.ex at b1efc790680d03baf5afb4896d6ec384a3605da4 · phoenixframework/phoenix · GitHub, check it out.
5 Likes
This is the best answer as it tells what to put in config.exs, the extra variable and its value… from the code in the run call in deps/phoenix/lib/mix/tasks/phx.server.ex
config :phoenix,
serve_endpoints: true