ZastrixArundell
How to create an application and run it another
Hi, I’m unsure how to form the title of the question (or the question overall) so I’m writing the best I can.
Until a bit ago I’ve only made Phoenix applications which didn’t have any separated functionalities per se outside of the app scope. Everything was in that Phoenix application.
Now I want to create an application which runs as a Discord bot independently but maybe at a later point use Phoenix with it. But instead of turning my Elixir app into a Phoenix application eventually, I’d like to create my Elixir app, put it on GitHub and then eventually use a completely new Phoenix app and call my Discord app as a hex dependency and run it under applications in mix.exs.
I have no clue how to google this properly nor find any info which seperated a normal elixir app than an api app (or how do I call it).
Most Liked
NobbZ
Totally depends.
Do you want to have the bot in its own application supervision tree, single instance? Or do you want it to be used and started as a subtree in the “host” applications supervision tree?
If you want it to run its own tree you need a :mod entry, if you want it to be a subtree, you don’t need it.
NobbZ
Every application can be run as dependency, the :mod entry has nothing to do with it.
:mod only determines whether or not an application has an entrypoint and therefore its own supervision tree.







