Skip to content

Instantly share code, notes, and snippets.

@mazz mazz/file.ex
Created Mar 22, 2019

Embed
What would you like to do?
routes chunk:
```
# ---- Pipelines ----
pipeline :browser do
plug :accepts, ["html"]
plug :fetch_session
plug :fetch_flash
plug :protect_from_forgery
plug :put_secure_browser_headers
plug(GuardianImpl.Pipeline)
end
scope "/", FaithfulWordApi do
pipe_through :browser # Use the default browser stack
get "/", PageController, :index
get "/about", PageController, :about
get "/login", LoginController, :new
post "/login", LoginController, :create
get "/signup", SignupController, :new
post "/signup", SignupController, :create
# get "/login/:magic_token", LoginController, :callback
end
```
## error
```
[error] #PID<0.659.0> running FaithfulWordApi.Endpoint (connection #PID<0.658.0>, stream id 1) terminated
Server: localhost:4000 (http)
Request: GET /
** (exit) an exception was raised:
** (Phoenix.Template.UndefinedError) Could not render "app.html" for FaithfulWordApi.LayoutView, please define a matching clause for render/2 or define a template at "lib/faithful_word_api/templates/layout". No templates were compiled for this module.
Assigns:
%{__phx_template_not_found__: FaithfulWordApi.LayoutView, conn: %Plug.Conn{adapter: {Plug.Cowboy.Conn, :...}, assigns: %{layout: {FaithfulWordApi.LayoutView, "app.html"}}, before_send: [#Function<0.76412652/1 in Plug.CSRFProtection.call/2>, #Function<2.38838910/1 in Phoenix.Controller.fetch_flash/2>, #Function<0.58261320/1 in Plug.Session.before_send/2>, #Function<1.112466771/1 in Plug.Logger.call/2>, #Function<0.89070732/1 in Phoenix.LiveReloader.before_send_inject_reloader/2>], body_params: %{}, cookies: %{"cookieconsent_status" => "dismiss"}, halted: false, host: "localhost", method: "GET", owner: #PID<0.659.0>, params: %{}, path_info: [], path_params: %{}, port: 4000, private: %{FaithfulWordApi.Router => {[], %{FaithfulWordApi.Bamboo.SentEmailViewerPlug => ["mail"]}}, :guardian_error_handler => FaithfulWord.Authenticator.GuardianImpl.ErrorHandler, :guardian_module => FaithfulWord.Authenticator.GuardianImpl, :phoenix_action => :index, :phoenix_controller => FaithfulWordApi.PageController, :phoenix_endpoint => FaithfulWordApi.Endpoint, :phoenix_flash => %{}, :phoenix_format => "html", :phoenix_layout => {FaithfulWordApi.LayoutView, :app}, :phoenix_pipelines => [:browser], :phoenix_router => FaithfulWordApi.Router, :phoenix_template => "index.html", :phoenix_view => FaithfulWordApi.PageView, :plug_session => %{}, :plug_session_fetch => :done}, query_params: %{}, query_string: "", remote_ip: {127, 0, 0, 1}, req_cookies: %{"cookieconsent_status" => "dismiss"}, req_headers: [{"accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8"}, {"accept-encoding", "gzip, deflate"}, {"accept-language", "en-US,en;q=0.5"}, {"connection", "keep-alive"}, {"cookie", "cookieconsent_status=dismiss"}, {"host", "localhost:4000"}, {"upgrade-insecure-requests", "1"}, {"user-agent", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:65.0) Gecko/20100101 Firefox/65.0"}], request_path: "/", resp_body: nil, resp_cookies: %{}, resp_headers: [{"cache-control", "max-age=0, private, must-revalidate"}, {"x-request-id", "2m72k1dm5ga6gakmj00000j1"}, {"x-frame-options", "SAMEORIGIN"}, {"x-xss-protection", "1; mode=block"}, {"x-content-type-options", "nosniff"}, {"strict-transport-security", "max-age=31536000; includeSubDomains"}, {"x-download-options", "noopen"}, {"x-permitted-cross-domain-policies", "none"}, {"cross-origin-window-policy", "deny"}], scheme: :http, script_name: [], secret_key_base: :..., state: :unset, status: nil}, view_module: FaithfulWordApi.PageView, view_template: "index.html"}
Assigned keys: [:__phx_template_not_found__, :conn, :view_module, :view_template]
(phoenix) lib/phoenix/template.ex:335: Phoenix.Template.raise_template_not_found/3
(phoenix) lib/phoenix/view.ex:399: Phoenix.View.render_to_iodata/3
(phoenix) lib/phoenix/controller.ex:729: Phoenix.Controller.__put_render__/5
(phoenix) lib/phoenix/controller.ex:746: Phoenix.Controller.instrument_render_and_send/4
(faithful_word_api) lib/controllers/page_controller.ex:1: FaithfulWordApi.PageController.action/2
(faithful_word_api) lib/controllers/page_controller.ex:1: FaithfulWordApi.PageController.phoenix_controller_pipeline/2
(faithful_word_api) lib/endpoint.ex:1: FaithfulWordApi.Endpoint.instrument/4
(phoenix) lib/phoenix/router.ex:275: Phoenix.Router.__call__/1
(faithful_word_api) lib/endpoint.ex:1: FaithfulWordApi.Endpoint.plug_builder_call/2
(faithful_word_api) lib/plug/debugger.ex:122: FaithfulWordApi.Endpoint."call (overridable 3)"/2
(faithful_word_api) lib/endpoint.ex:1: FaithfulWordApi.Endpoint.call/2
(phoenix) lib/phoenix/endpoint/cowboy2_handler.ex:33: Phoenix.Endpoint.Cowboy2Handler.init/2
(cowboy) /Users/michael/src/phx/faithfulword-phx/deps/cowboy/src/cowboy_handler.erl:41: :cowboy_handler.execute/2
(cowboy) /Users/michael/src/phx/faithfulword-phx/deps/cowboy/src/cowboy_stream_h.erl:296: :cowboy_stream_h.execute/3
(cowboy) /Users/michael/src/phx/faithfulword-phx/deps/cowboy/src/cowboy_stream_h.erl:274: :cowboy_stream_h.request_process/3
(stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.