1
0
mirror of https://github.com/mgerb/classic-wow-forums synced 2026-01-11 09:32:51 +00:00

server - added distillery for prod builds

This commit is contained in:
2018-01-22 16:03:12 -06:00
parent 0d3a92c28d
commit 259c270c51
20 changed files with 251 additions and 64 deletions

View File

@@ -6,11 +6,11 @@ defmodule MyAppWeb.PageController do
def index(conn, _params) do
# cache index.html if prod
file = case Mix.env do
:dev -> File.read!("./priv/static/index.html")
_ ->
file = case System.get_env("MIX_ENV") do
:prod ->
file = Cachex.get(:myapp, "index.html")
|> get_file
_ -> File.read!(Application.app_dir(:myapp, "priv/static/index.html"))
end
conn
@@ -19,7 +19,7 @@ defmodule MyAppWeb.PageController do
defp get_file({:ok, data}), do: data
defp get_file({:missing, _}) do
file = File.read!("./priv/static/index.html")
file = File.read!(Application.app_dir(:myapp, "priv/static/index.html"))
Cachex.set(:myapp, "index.html", file)
file
end