What mix task phx.server really do under the hood?
Just starts the application in a regular way, but with extra application env variable (
serve_endpoints) which states that the listener must be started
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
For phoenix, the file is phoenix/phx.server.ex at b1efc790680d03baf5afb4896d6ec384a3605da4 · phoenixframework/phoenix · GitHub, check it out.