I'm using Phoenix (v1.2.1) to build a REST API, but I know very little about Elixir and pretty much zero about Erlang.
As part of the create
action on one of my controllers, group_controller.ex
, I need to query an external source to generate some data. The logic for producing this query is in an Erlang dependency that has been added to my mix.exs
deps and successfully installed in the deps
directory... so that is all good.
However, I haven't the slightest idea how to import the module or access its functionality in my controller (or anywhere in my app, for that matter). Can I even use an Erlang dependency out of the box in a Phoenix app, or does it need to be transpiled to Elixir?
If I were writing this in ES6, I would write something like
import {FunctionA, FunctionB} from 'module'
easy as pie... how can I accomplish that in Phoenix when the dependency is written in Erlang?
Thank you!
:module.functionA(args)
? Post details of the module/method you want to use, so we can better answer you question. – Sheharyar