Changeset View
Changeset View
Standalone View
Standalone View
lib/kolab_chat/web/router.ex
- This file was moved from web/router.ex.
defmodule KolabChat.Router do | defmodule KolabChat.Web.Router do | ||||
use KolabChat.Web, :router | use KolabChat.Web, :router | ||||
pipeline :browser do | pipeline :browser do | ||||
plug :accepts, ["html"] | plug :accepts, ["html"] | ||||
plug :fetch_session | plug :fetch_session | ||||
plug :fetch_flash | plug :fetch_flash | ||||
plug :protect_from_forgery | plug :protect_from_forgery | ||||
plug :put_secure_browser_headers | plug :put_secure_browser_headers | ||||
plug KolabChat.Plugs.Locale | plug KolabChat.Plugs.Locale | ||||
plug KolabChat.Plugs.SetUser | plug KolabChat.Plugs.SetUser | ||||
end | end | ||||
pipeline :api do | pipeline :api do | ||||
plug :accepts, ["json"] | plug :accepts, ["json"] | ||||
end | end | ||||
scope "/", KolabChat do | scope "/", KolabChat.Web do | ||||
pipe_through :browser | pipe_through :browser | ||||
get "/", PageController, :index | get "/", PageController, :index | ||||
end | end | ||||
scope "/chat", KolabChat do | scope "/chat", KolabChat.Web do | ||||
pipe_through :browser | pipe_through :browser | ||||
get "/", ChatController, :index | get "/", ChatController, :index | ||||
get "/:room", ChatController, :index | get "/:room", ChatController, :index | ||||
end | end | ||||
scope "/auth", KolabChat do | scope "/auth", KolabChat.Web do | ||||
pipe_through :browser | pipe_through :browser | ||||
post "/default/callback", AuthController, :default_callback | post "/default/callback", AuthController, :default_callback | ||||
get "/logout", AuthController, :logout | get "/logout", AuthController, :logout | ||||
end | end | ||||
# Other scopes may use custom stacks. | # Other scopes may use custom stacks. | ||||
# scope "/api", KolabChat do | # scope "/api", KolabChat do | ||||
# pipe_through :api | # pipe_through :api | ||||
# end | # end | ||||
end | end |