-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrouter.ex
37 lines (29 loc) · 802 Bytes
/
router.ex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
defmodule Discuss.Router do
use Discuss.Web, :router
pipeline :browser do
plug :accepts, ["html"]
plug :fetch_session
plug :fetch_flash
plug :protect_from_forgery
plug :put_secure_browser_headers
plug Discuss.Plugs.CurrentUser
end
pipeline :api do
plug :accepts, ["json"]
end
scope "/", Discuss do
pipe_through :browser # Use the default browser stack
get "/", TopicController, :index
resources "/topics", TopicController
end
scope "/auth", Discuss do
pipe_through :browser
get "/signout", AuthController, :signout
get "/:provider", AuthController, :request
get "/:provider/callback", AuthController, :callback
end
# Other scopes may use custom stacks.
# scope "/api", Discuss do
# pipe_through :api
# end
end