Я пытаюсь создать JSON-сервер для Elm. Я хочу только одну страницу - elm.html, один файл js - Main.js - и один файл css.Статическая HTML-страница в Phoenix
Я пробовал following these instructions, но там не достаточно, чтобы помочь новичку, как я.
Так что теперь у меня есть router.ex
scope "/", JwtExample do
pipe_through :browser # Use the default browser stack
get "/elm", RootController, :index
get "/", PageController, :index
end
# Other scopes may use custom stacks.
scope "/api", JwtExample do
pipe_through :api
resources "/users", UserController, except: [:new, :edit]
end
Этот контроллер
defmodule JwtExample.RootController do
use JwtExample.Web, :controller
plug :action
def index(conn, _params) do
redirect conn, to: "/elm.html"
end
end
И мои файлы web/static
и priv/static
Но когда я по поиску в/вяз я получаю
не найдено для маршрута GET /elm.html (JwtExample.Router)
См. Http://stackoverflow.com/questions/35100117/how-to-serve-static-page-in-phoenix-framework – psantos