mobilizon/lib/eventos_web/router.ex

37 lines
988 B
Elixir
Raw Normal View History

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
end
2017-12-09 14:58:37 +01:00
scope "/api" do
pipe_through :api
2017-12-09 14:58:37 +01:00
resources "/users", UserController, only: [:create]
post "/sign-in", EventosWeb.SessionController, :sign_in
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
end
end