diff --git a/lib/recycledcloud.ex b/lib/recycledcloud.ex index d6d0728..9a80729 100644 --- a/lib/recycledcloud.ex +++ b/lib/recycledcloud.ex @@ -6,4 +6,12 @@ defmodule RecycledCloud do Contexts are also responsible for managing your data, regardless if it comes from the database, an external API or others. """ + + # Mix is not available in releases, and these things are static + # anyway (@variables are evaluated at compile time). + @version Mix.Project.config[:version] + @env Mix.env + + def version, do: @version + def env, do: @env end diff --git a/lib/recycledcloud_web/router.ex b/lib/recycledcloud_web/router.ex index d02b0ec..4f53843 100644 --- a/lib/recycledcloud_web/router.ex +++ b/lib/recycledcloud_web/router.ex @@ -69,7 +69,7 @@ defmodule RecycledCloudWeb.Router do # In-memory mailer for development purposes only. # See https://hexdocs.pm/bamboo/Bamboo.SentEmailViewerPlug.html for details. - if Mix.env == :dev do + if RecycledCloud.env() == :dev do forward "/outbox", Bamboo.SentEmailViewerPlug end end diff --git a/lib/recycledcloud_web/templates/layout/app.html.eex b/lib/recycledcloud_web/templates/layout/app.html.eex index 854e6fc..780756e 100644 --- a/lib/recycledcloud_web/templates/layout/app.html.eex +++ b/lib/recycledcloud_web/templates/layout/app.html.eex @@ -15,7 +15,7 @@ ">