Skip to content

Instantly share code, notes, and snippets.

@Maartz
Created May 19, 2020 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Maartz/ae20e3eb350f1eba1d58d51754c8277f to your computer and use it in GitHub Desktop.
Save Maartz/ae20e3eb350f1eba1d58d51754c8277f to your computer and use it in GitHub Desktop.
liveview router
defmodule LiveViewStudioWeb.Router do
use LiveViewStudioWeb, :router
pipeline :browser do
plug :accepts, ["html"]
plug :fetch_session
plug :fetch_live_flash
plug :put_root_layout, {LiveViewStudioWeb.LayoutView, :root}
plug :protect_from_forgery
plug :put_secure_browser_headers
end
pipeline :api do
plug :accepts, ["json"]
end
scope "/", LiveViewStudioWeb do
pipe_through :browser
live "/", PageLive
live "/light", LigthLive # Live elixir macro
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment