diff --git a/.gitignore b/.gitignore index 114e2e6..ed636be 100644 --- a/.gitignore +++ b/.gitignore @@ -3,12 +3,12 @@ thumbs.db # Frontend stuff -/frontend/node_modules -/frontend/build +/priv/frontend/node_modules +/priv/frontend/build -npm-debug.log* -yarn-debug.log* -yarn-error.log* +/priv/npm-debug.log* +/priv/yarn-debug.log* +/priv/yarn-error.log* # The directory Mix will write compiled artifacts to. /_build/ @@ -36,3 +36,4 @@ elstat-*.tar *.db config/config.exs + diff --git a/lib/cowboy.ex b/lib/cowboy.ex index 0e4b649..9049455 100644 --- a/lib/cowboy.ex +++ b/lib/cowboy.ex @@ -30,11 +30,10 @@ defmodule Elstat.Cowboy do def build_dispatch_config do :cowboy_router.compile([ {:_, [ - {"/", :cowboy_static, {:file, "static/index.html"}}, {"/hewwo", Elstat.Cowboy.DefaultHandler, []}, {"/api/current_status", Elstat.API.CurrentStatus, []}, - {"/api/status", Elstat.API.Status, []} - + {"/api/status", Elstat.API.Status, []}, + {"/[...]", :cowboy_static, {:priv_dir, :elstat, "frontend/build"}}, ]} ]) end diff --git a/frontend/README.md b/priv/frontend/README.md similarity index 100% rename from frontend/README.md rename to priv/frontend/README.md diff --git a/frontend/package.json b/priv/frontend/package.json similarity index 100% rename from frontend/package.json rename to priv/frontend/package.json diff --git a/frontend/public/index.html b/priv/frontend/public/index.html similarity index 100% rename from frontend/public/index.html rename to priv/frontend/public/index.html diff --git a/frontend/src/App.css b/priv/frontend/src/App.css similarity index 100% rename from frontend/src/App.css rename to priv/frontend/src/App.css diff --git a/frontend/src/App.js b/priv/frontend/src/App.js similarity index 100% rename from frontend/src/App.js rename to priv/frontend/src/App.js diff --git a/frontend/src/Graph.css b/priv/frontend/src/Graph.css similarity index 100% rename from frontend/src/Graph.css rename to priv/frontend/src/Graph.css diff --git a/frontend/src/Graph.js b/priv/frontend/src/Graph.js similarity index 100% rename from frontend/src/Graph.js rename to priv/frontend/src/Graph.js diff --git a/frontend/src/Service.css b/priv/frontend/src/Service.css similarity index 100% rename from frontend/src/Service.css rename to priv/frontend/src/Service.css diff --git a/frontend/src/Service.js b/priv/frontend/src/Service.js similarity index 100% rename from frontend/src/Service.js rename to priv/frontend/src/Service.js diff --git a/frontend/src/index.css b/priv/frontend/src/index.css similarity index 100% rename from frontend/src/index.css rename to priv/frontend/src/index.css diff --git a/frontend/src/index.js b/priv/frontend/src/index.js similarity index 100% rename from frontend/src/index.js rename to priv/frontend/src/index.js diff --git a/frontend/yarn.lock b/priv/frontend/yarn.lock similarity index 100% rename from frontend/yarn.lock rename to priv/frontend/yarn.lock