frenzy/lib/frenzy_web/router.ex

67 lines
1.8 KiB
Elixir
Raw Normal View History

2019-02-11 22:22:35 +00:00
defmodule FrenzyWeb.Router do
use FrenzyWeb, :router
pipeline :browser do
plug :accepts, ["html"]
plug :fetch_session
plug :fetch_flash
plug :protect_from_forgery
plug :put_secure_browser_headers
2019-03-23 23:42:38 +00:00
end
pipeline :authenticate do
# plug :accepts, ["html"]
# plug :fetch_session
# plug :fetch_flash
# plug :protect_from_forgery
# plug :put_secure_browser_headers
plug FrenzyWeb.Plug.Authenticate
2019-02-11 22:22:35 +00:00
end
pipeline :api do
plug :accepts, ["json"]
end
scope "/", FrenzyWeb do
pipe_through :browser
2019-03-23 23:42:38 +00:00
get "/login", LoginController, :login
post "/login", LoginController, :login_post
end
scope "/", FrenzyWeb do
pipe_through :browser
pipe_through :authenticate
2019-03-21 23:21:56 +00:00
get "/", GroupController, :index
resources "/groups", GroupController, except: [:edit, :update]
2019-02-11 22:22:35 +00:00
2019-03-21 23:21:56 +00:00
resources "/feeds", FeedController, only: [:show, :create, :delete]
2019-02-11 22:22:35 +00:00
post "/feeds/:id/refresh", FeedController, :refresh
2019-03-10 23:47:01 +00:00
post "/feeds/:id/enable_filter", FeedController, :enable_filter
post "/feeds/:id/disable_filter", FeedController, :disable_filter
resources "/filters", FilterController, only: [:edit, :update]
post "/filters/:id/add_rule", FilterController, :add_rule
2019-03-15 02:32:20 +00:00
post "/filters/:id/remove_rule", FilterController, :remove_rule
2019-02-11 22:22:35 +00:00
resources "/items", ItemController, only: [:show]
post "/items/:id/read", ItemController, :read
post "/items/:id/unread", ItemController, :unread
end
scope "/", FrenzyWeb do
pipe_through :api
get "/fever", FeverController, :get
get "/api/fever.php", FeverController, :get
post "/fever", FeverController, :post
post "/api/fever.php", FeverController, :post
end
# Other scopes may use custom stacks.
# scope "/api", FrenzyWeb do
# pipe_through :api
# end
end