I defined an environment variable associated with the manual , my mix.exs
defmodule Basic.Mixfile do
use Mix.Project
def project do
[app: :basic,
version: "0.0.1",
elixir: "~> 0.13.0-dev",
deps: deps,
env: [
dev: [foo: "bar"] ] ]
end
def application do
[ applications: [],
mod: { Basic, [] } ]
end
defp deps do
[]
end
end
and then I start the project with iex -S mixor MIX_ENV=dev iex -S mix, I want to get the environment variable with :application.get_env(:basic, :foo), she turned to :undefined; and use :application.get_all_env(:basic), he returned [included_applications: []], there is no variable env. And my question is: how do I get the environment value?
source
share