Skip to content

Commit e0afa53

Browse files
committed
Configure the router
1 parent 13b3094 commit e0afa53

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

web/router.ex

+2-15
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,13 @@
11
defmodule RestApi.Router do
22
use RestApi.Web, :router
33

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-
124
pipeline :api do
135
plug :accepts, ["json"]
146
end
157

168
scope "/", RestApi do
17-
pipe_through :browser # Use the default browser stack
9+
pipe_through :api
1810

19-
get "/", PageController, :index
11+
resources "/posts", PostController
2012
end
21-
22-
# Other scopes may use custom stacks.
23-
# scope "/api", RestApi do
24-
# pipe_through :api
25-
# end
2613
end

0 commit comments

Comments
 (0)