I defined a environment variable related to the guide-started, my mix.exs is
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
# Configuration for the OTP application
#
# Type `mix help compile.app` for more information
def application do
[ applications: [],
mod: { Basic, [] } ]
end
# List all dependencies in the format:
#
# { :foobar, git: "https://github.com/elixir-lang/foobar.git", tag: "0.1" }
#
# Type `mix help deps` for more examples and options
defp deps do
[]
end
end
and then I start the project with iex -S mix
or MIX_ENV=dev iex -S mix
, I want to get the environment variable with :application.get_env(:basic, :foo)
, it turned to :undefined
; and use :application.get_all_env(:basic)
, it returned [included_applications: []]
, there is not the env
variable. And my question is how should I get the environment value?