I’m building an umbrella app where at least some of the apps are Phoenix apps. Most of the time (including in production), I launch the “main” app and have it forward requests to the appropriate child. Sometimes, though, I want to test just this application.
So that means I need the child app’s endpoint to be launched, but only when launching standalone. Right now I’m doing that by sniffing the output of System.get_cwd/0
like this:
was_launched_standalone? = System.cwd |> Path.basename |> String.equivalent?("user")
but that feels hacky. Is there a more appropriate way to ask this question?