I'm trying to build a JSON backend for Elm. I only want to serve one page - elm.html, one js file - Main.js - and one css file.
I tried following these instructions but there is not enough there to help a complete newbie like me.
So now I have router.ex
scope "/", JwtExample do
pipe_through :browser # Use the default browser stack
get "/elm", RootController, :index
get "/", PageController, :index
# Other scopes may use custom stacks.
scope "/api", JwtExample do
resources "/users", UserController, except: [:new, :edit]
defmodule JwtExample.RootController do
use JwtExample.Web, :controller
def index(conn, _params) do
redirect conn, to: "/elm.html"
no route found for GET /elm.html (JwtExample.Router)
OK, so based on psantos answer, I needed to change lib/endpoint.ex to read
plug Plug.Static, at: "/", from: :jwt_example, gzip: false, only: ~w(css fonts images js favicon.ico robots.txt elm.html)