Kurisu
Importing a Phoenix app as a dependency in another phoenix app in an umbrella project... Please any advice?
I have two Phoenix web app in an umbrella project: admin and front. I will probably add another web app blog soon.
I added :front app as a dependency in the :admin app so I can generate urls to the “Front website”. This work fine as long as I start the Phoenix server ever:
- only from the
adminapp root - only from the
frontapp root - or from the
umbrellaproject root
In the last case both apps are available in the browser at http://localhost:4000/ and http://localhost:4001/. If I try to start the apps separetely, the last I try to start will fail with the following error:
03:48:13.459 [error] Failed to start Ranch listener Front.Endpoint.HTTP in :ranch_tcp:listen([cacerts: :…, key: :…, cert: :…, port: 4000]) for reason :eaddrinuse (address already in use)
So I vaguely understand that there is something like a listening conflict on a port?
But when starting the server from the umbrella perpective, put in simple words, why is it working?
And more importantly should I be aware of a potential issue in the future? I mean as long as it’s ok for me not to deploy the apps separately.
Thanks.
Marked As Solved
NobbZ
You say that one app depends on the other, so if you start that app, it will also try to start the other. Though if you have the other already up and running in another BEAM instance, then of course that port will already be in use.
It should be enough to start the app that depends on the other, to access both applications, or to start from the umbrella.
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









