initial commit

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2017-12-08 09:58:14 +01:00
commit 90ceb4f6fe
181 changed files with 8219 additions and 0 deletions

63
lib/eventos_web/router.ex Normal file
View File

@@ -0,0 +1,63 @@
defmodule EventosWeb.Router do
use EventosWeb, :router
use Coherence.Router
pipeline :browser do
plug :accepts, ["html"]
plug :fetch_session
plug :fetch_flash
plug :protect_from_forgery
plug :put_secure_browser_headers
plug Coherence.Authentication.Session
end
pipeline :protected do
plug :accepts, ["html"]
plug :fetch_session
plug :fetch_flash
plug :protect_from_forgery
plug :put_secure_browser_headers
plug Coherence.Authentication.Session, protected: true
end
pipeline :api do
plug :accepts, ["json"]
end
scope "/" do
pipe_through :browser
coherence_routes()
end
# Add this block
scope "/" do
pipe_through :protected
coherence_routes :protected
end
scope "/", EventosWeb do
pipe_through :browser # Use the default browser stack
get "/", PageController, :index
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
scope "/", EventosWeb do
pipe_through :protected
# Add protected routes below
end
# Other scopes may use custom stacks.
scope "/api", EventosWeb do
pipe_through :api
end
end