2017-12-08 09:58:14 +01:00
|
|
|
defmodule EventosWeb.Router do
|
|
|
|
use EventosWeb, :router
|
|
|
|
|
|
|
|
pipeline :api do
|
|
|
|
plug :accepts, ["json"]
|
|
|
|
end
|
|
|
|
|
2017-12-09 14:58:37 +01:00
|
|
|
pipeline :api_auth do
|
|
|
|
plug EventosWeb.AuthPipeline
|
2017-12-08 09:58:14 +01:00
|
|
|
end
|
|
|
|
|
2017-12-09 14:58:37 +01:00
|
|
|
scope "/api" do
|
|
|
|
pipe_through :api
|
2017-12-08 09:58:14 +01:00
|
|
|
|
2017-12-09 14:58:37 +01:00
|
|
|
resources "/users", UserController, only: [:create]
|
|
|
|
post "/sign-in", EventosWeb.SessionController, :sign_in
|
2017-12-08 09:58:14 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
# Other scopes may use custom stacks.
|
|
|
|
scope "/api", EventosWeb do
|
2017-12-09 14:58:37 +01:00
|
|
|
pipe_through :api_auth
|
|
|
|
|
|
|
|
|
|
|
|
post "/sign-out", SessionController, :sign_out
|
|
|
|
resources "/users", UserController
|
|
|
|
resources "/accounts", AccountController
|
|
|
|
resources "/events", EventController
|
|
|
|
resources "/categories", CategoryController
|
|
|
|
resources "/tags", TagController
|
|
|
|
resources "/event_accounts", EventAccountsController
|
|
|
|
resources "/event_requests", EventRequestController
|
|
|
|
resources "/groups", GroupController
|
|
|
|
resources "/group_accounts", GroupAccountController
|
|
|
|
resources "/group_requests", GroupRequestController
|
2017-12-08 09:58:14 +01:00
|
|
|
end
|
|
|
|
end
|