52 lines
1.5 kB
1
defmodule BlogWeb.Router do
2
use BlogWeb, :router
3
4
pipeline :browser do
5
plug :accepts, ["html"]
6
plug :fetch_session
7
plug :fetch_live_flash
8
plug :put_root_layout, html: {BlogWeb.Layouts, :root}
9
plug :protect_from_forgery
10
plug :put_secure_browser_headers
11
end
12
13
pipeline :api do
14
plug :accepts, ["json"]
15
end
16
17
scope "/", BlogWeb do
18
pipe_through :browser
19
20
live "/", PostLive.Index
21
live "/post/:slug", PostLive
22
live "/grid", GridLive, :index
23
live "/muenster", MuensterLive
24
live "/faketweets", FakeTweetsLive
25
live "/vim", VimTweetsLive
26
live "/keylogger", KeyloggerLive
27
live "/gay_chaos", RainbowLive, :index
28
live "/mirror", MirrorLive, :index
29
end
30
31
# Other scopes may use custom stacks.
32
# scope "/api", BlogWeb do
33
# pipe_through :api
34
# end
35
36
# Enable LiveDashboard and Swoosh mailbox preview in development
37
if Application.compile_env(:blog, :dev_routes) do
38
# If you want to use the LiveDashboard in production, you should put
39
# it behind authentication and allow only admins to access it.
40
# If your application does not have an admins-only section yet,
41
# you can use Plug.BasicAuth to set up some basic authentication
42
# as long as you are also using SSL (which you should anyway).
43
import Phoenix.LiveDashboard.Router
44
45
scope "/dev" do
46
pipe_through :browser
47
48
live_dashboard "/dashboard", metrics: BlogWeb.Telemetry
49
forward "/mailbox", Plug.Swoosh.MailboxPreview
50
end
51
end
52
end
53