From bc01717da079e622d7828521e5048f513c6ff796 Mon Sep 17 00:00:00 2001 From: Luna Mendes Date: Tue, 12 Jun 2018 19:25:49 -0300 Subject: [PATCH] move frontend to priv folder also map / to frontend folder inside priv --- .gitignore | 11 ++++++----- lib/cowboy.ex | 5 ++--- {frontend => priv/frontend}/README.md | 0 {frontend => priv/frontend}/package.json | 0 {frontend => priv/frontend}/public/index.html | 0 {frontend => priv/frontend}/src/App.css | 0 {frontend => priv/frontend}/src/App.js | 0 {frontend => priv/frontend}/src/Graph.css | 0 {frontend => priv/frontend}/src/Graph.js | 0 {frontend => priv/frontend}/src/Service.css | 0 {frontend => priv/frontend}/src/Service.js | 0 {frontend => priv/frontend}/src/index.css | 0 {frontend => priv/frontend}/src/index.js | 0 {frontend => priv/frontend}/yarn.lock | 0 14 files changed, 8 insertions(+), 8 deletions(-) rename {frontend => priv/frontend}/README.md (100%) rename {frontend => priv/frontend}/package.json (100%) rename {frontend => priv/frontend}/public/index.html (100%) rename {frontend => priv/frontend}/src/App.css (100%) rename {frontend => priv/frontend}/src/App.js (100%) rename {frontend => priv/frontend}/src/Graph.css (100%) rename {frontend => priv/frontend}/src/Graph.js (100%) rename {frontend => priv/frontend}/src/Service.css (100%) rename {frontend => priv/frontend}/src/Service.js (100%) rename {frontend => priv/frontend}/src/index.css (100%) rename {frontend => priv/frontend}/src/index.js (100%) rename {frontend => priv/frontend}/yarn.lock (100%) 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