move frontend to priv folder
also map / to frontend folder inside priv
This commit is contained in:
parent
dd1e8c1fc0
commit
bc01717da0
14 changed files with 8 additions and 8 deletions
11
.gitignore
vendored
11
.gitignore
vendored
|
@ -3,12 +3,12 @@
|
||||||
thumbs.db
|
thumbs.db
|
||||||
|
|
||||||
# Frontend stuff
|
# Frontend stuff
|
||||||
/frontend/node_modules
|
/priv/frontend/node_modules
|
||||||
/frontend/build
|
/priv/frontend/build
|
||||||
|
|
||||||
npm-debug.log*
|
/priv/npm-debug.log*
|
||||||
yarn-debug.log*
|
/priv/yarn-debug.log*
|
||||||
yarn-error.log*
|
/priv/yarn-error.log*
|
||||||
|
|
||||||
# The directory Mix will write compiled artifacts to.
|
# The directory Mix will write compiled artifacts to.
|
||||||
/_build/
|
/_build/
|
||||||
|
@ -36,3 +36,4 @@ elstat-*.tar
|
||||||
|
|
||||||
*.db
|
*.db
|
||||||
config/config.exs
|
config/config.exs
|
||||||
|
|
||||||
|
|
|
@ -30,11 +30,10 @@ defmodule Elstat.Cowboy do
|
||||||
def build_dispatch_config do
|
def build_dispatch_config do
|
||||||
:cowboy_router.compile([
|
:cowboy_router.compile([
|
||||||
{:_, [
|
{:_, [
|
||||||
{"/", :cowboy_static, {:file, "static/index.html"}},
|
|
||||||
{"/hewwo", Elstat.Cowboy.DefaultHandler, []},
|
{"/hewwo", Elstat.Cowboy.DefaultHandler, []},
|
||||||
{"/api/current_status", Elstat.API.CurrentStatus, []},
|
{"/api/current_status", Elstat.API.CurrentStatus, []},
|
||||||
{"/api/status", Elstat.API.Status, []}
|
{"/api/status", Elstat.API.Status, []},
|
||||||
|
{"/[...]", :cowboy_static, {:priv_dir, :elstat, "frontend/build"}},
|
||||||
]}
|
]}
|
||||||
])
|
])
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue