7b20d95134282791d81e814e0f123306924e1b72
[tech-radar-editor.git] / web / router.ex
1 defmodule TechRadarEditor.Router do
2 use TechRadarEditor.Web, :router
3
4 pipeline :browser do
5 plug :accepts, ["html"]
6 plug :fetch_session
7 plug :fetch_flash
8 plug :protect_from_forgery
9 plug :put_secure_browser_headers
10 end
11
12 pipeline :api do
13 plug :accepts, ["json"]
14 end
15
16 scope "/", TechRadarEditor do
17 pipe_through :browser # Use the default browser stack
18
19 # get "/", PageController, :index
20 # get "/radar", RadarController, :index
21
22 # get "/original", PageController, :index
23 # get "/", RadarController, :index
24 # post "/", RadarController, :create # ????
25
26 resources "/", RadarController, only: [:index, :create, :delete]
27 end
28
29 scope "/admin", TechRadarEditor do
30 pipe_through :browser
31 resources "/radar_data_point", RadarDataPointController
32 end
33
34 # Other scopes may use custom stacks.
35 # scope "/api", TechRadarEditor do
36 # pipe_through :api
37 # end
38 end