frenzy/lib/frenzy_web/router.ex

108 lines
3.6 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
2019-03-31 14:52:56 +00:00
pipeline :browser_authenticate do
2019-03-23 23:42:38 +00:00
plug FrenzyWeb.Plug.Authenticate
2019-02-11 22:22:35 +00:00
end
pipeline :api do
plug :accepts, ["json"]
end
2019-03-31 14:52:56 +00:00
pipeline :fervor_authenticate do
plug FrenzyWeb.Plug.FervorAuthenticate
end
2019-02-11 22:22:35 +00:00
scope "/", FrenzyWeb do
pipe_through :browser
2019-03-23 23:42:38 +00:00
get "/login", LoginController, :login
post "/login", LoginController, :login_post
2019-03-31 14:52:56 +00:00
2019-04-01 15:34:26 +00:00
get "/logout", LoginController, :logout
2019-03-31 14:52:56 +00:00
get "/oauth/authorize", Fervor.OauthController, :authorize_get
post "/oauth/authorize", Fervor.OauthController, :authorize_post
2019-03-23 23:42:38 +00:00
end
scope "/", FrenzyWeb do
pipe_through :browser
2019-03-31 14:52:56 +00:00
pipe_through :browser_authenticate
2019-03-23 23:42:38 +00:00
2019-03-31 15:52:20 +00:00
get "/account", AccountController, :show
get "/account/change_password", AccountController, :change_password
post "/account/change_password", AccountController, :do_change_password
2019-03-31 17:19:11 +00:00
get "/account/change_fever_password", AccountController, :change_fever_password
post "/account/change_fever_password", AccountController, :do_change_fever_password
2019-04-01 15:29:03 +00:00
post "/account/remove_client", AccountController, :remove_client
2019-03-31 15:52:20 +00:00
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
resources "/feeds", FeedController, except: [:index, :new]
2019-02-11 22:22:35 +00:00
post "/feeds/:id/refresh", FeedController, :refresh
#post "/feeds/:id/enable_filter", FeedController, :enable_filter
#post "/feeds/:id/disable_filter", FeedController, :disable_filter
2019-03-10 23:47:01 +00:00
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
2019-03-31 14:52:56 +00:00
scope "/", FrenzyWeb.Fervor do
2019-03-28 21:11:25 +00:00
pipe_through :api
2019-03-31 14:52:56 +00:00
post "/api/v1/register", MiscController, :register
2019-03-28 21:11:25 +00:00
post "/oauth/token", OauthController, :token
2019-03-31 14:52:56 +00:00
get "/api/v1/instance", MiscController, :instance
end
2019-03-28 21:11:25 +00:00
2019-03-31 14:52:56 +00:00
scope "/", FrenzyWeb.Fervor do
pipe_through :api
pipe_through :fervor_authenticate
get "/api/v1/groups", GroupsController, :groups_list
get "/api/v1/groups/:id", GroupsController, :specific_group
get "/api/v1/groups/:id/feeds", GroupsController, :specific_group_feeds
get "/api/v1/groups/:id/items", GroupsController, :specific_group_items
post "/api/v1/groups/create", GroupsController, :create
post "/api/v1/groups/:id/delete", GroupsController, :delete
get "/api/v1/feeds", FeedsController, :feeds_list
get "/api/v1/feeds/:id", FeedsController, :specific_feed
get "/api/v1/feeds/:id/items", FeedsController, :specific_feed_items
post "/api/v1/feeds/create", FeedsController, :create
post "/api/v1/feeds/:id/delete", FeedsController, :delete
get "/api/v1/items", ItemsController, :items_list
get "/api/v1/items/:id", ItemsController, :specific_item
post "/api/v1/items/:id/read", ItemsController, :read_specific_item
post "/api/v1/items/:id/unread", ItemsController, :unread_specific_item
post "/api/v1/items/read", ItemsController, :read_multiple
post "/api/v1/items/unread", ItemsController, :unread_multiple
2019-03-28 21:11:25 +00:00
end
2019-02-11 22:22:35 +00:00
end