2019-02-11 17:22:35 -05: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 19:42:38 -04:00
|
|
|
end
|
|
|
|
|
2019-03-31 10:52:56 -04:00
|
|
|
pipeline :browser_authenticate do
|
2019-03-23 19:42:38 -04:00
|
|
|
plug FrenzyWeb.Plug.Authenticate
|
2019-02-11 17:22:35 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
pipeline :api do
|
|
|
|
plug :accepts, ["json"]
|
|
|
|
end
|
|
|
|
|
2019-03-31 10:52:56 -04:00
|
|
|
pipeline :fervor_authenticate do
|
|
|
|
plug FrenzyWeb.Plug.FervorAuthenticate
|
|
|
|
end
|
|
|
|
|
2019-02-11 17:22:35 -05:00
|
|
|
scope "/", FrenzyWeb do
|
|
|
|
pipe_through :browser
|
|
|
|
|
2019-03-23 19:42:38 -04:00
|
|
|
get "/login", LoginController, :login
|
|
|
|
post "/login", LoginController, :login_post
|
2019-03-31 10:52:56 -04:00
|
|
|
|
2019-04-01 11:34:26 -04:00
|
|
|
get "/logout", LoginController, :logout
|
|
|
|
|
2019-03-31 10:52:56 -04:00
|
|
|
get "/oauth/authorize", Fervor.OauthController, :authorize_get
|
|
|
|
post "/oauth/authorize", Fervor.OauthController, :authorize_post
|
2019-03-23 19:42:38 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
scope "/", FrenzyWeb do
|
|
|
|
pipe_through :browser
|
2019-03-31 10:52:56 -04:00
|
|
|
pipe_through :browser_authenticate
|
2019-03-23 19:42:38 -04:00
|
|
|
|
2019-03-31 11:52:20 -04:00
|
|
|
get "/account", AccountController, :show
|
|
|
|
get "/account/change_password", AccountController, :change_password
|
|
|
|
post "/account/change_password", AccountController, :do_change_password
|
2019-03-31 13:19:11 -04:00
|
|
|
get "/account/change_fever_password", AccountController, :change_fever_password
|
|
|
|
post "/account/change_fever_password", AccountController, :do_change_fever_password
|
2019-04-01 11:29:03 -04:00
|
|
|
post "/account/remove_client", AccountController, :remove_client
|
2019-08-30 14:27:52 -04:00
|
|
|
post "/account/import", AccountController, :import
|
2019-08-30 19:44:51 -04:00
|
|
|
post "/account/export", AccountController, :export
|
2019-03-31 11:52:20 -04:00
|
|
|
|
2019-03-21 19:21:56 -04:00
|
|
|
get "/", GroupController, :index
|
|
|
|
resources "/groups", GroupController, except: [:edit, :update]
|
2019-02-11 17:22:35 -05:00
|
|
|
|
2019-07-05 22:00:18 -04:00
|
|
|
resources "/feeds", FeedController, except: [:index, :new]
|
2019-02-11 17:22:35 -05:00
|
|
|
post "/feeds/:id/refresh", FeedController, :refresh
|
2019-07-20 19:08:56 -04:00
|
|
|
|
2019-11-08 22:27:46 -05:00
|
|
|
resources "/pipelines", PipelineController
|
2019-03-10 19:47:01 -04:00
|
|
|
|
2019-02-11 17:22:35 -05: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
|
|
|
|
|
2019-11-10 14:54:58 -05:00
|
|
|
post "/", FeverController, :post
|
2019-02-11 17:22:35 -05:00
|
|
|
get "/fever", FeverController, :get
|
|
|
|
get "/api/fever.php", FeverController, :get
|
|
|
|
post "/fever", FeverController, :post
|
|
|
|
post "/api/fever.php", FeverController, :post
|
|
|
|
end
|
|
|
|
|
2019-03-31 10:52:56 -04:00
|
|
|
scope "/", FrenzyWeb.Fervor do
|
2019-03-28 17:11:25 -04:00
|
|
|
pipe_through :api
|
|
|
|
|
2019-03-31 10:52:56 -04:00
|
|
|
post "/api/v1/register", MiscController, :register
|
2019-03-28 17:11:25 -04:00
|
|
|
|
|
|
|
post "/oauth/token", OauthController, :token
|
|
|
|
|
2019-03-31 10:52:56 -04:00
|
|
|
get "/api/v1/instance", MiscController, :instance
|
|
|
|
end
|
2019-03-28 17:11:25 -04:00
|
|
|
|
2019-03-31 10:52:56 -04: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 17:11:25 -04:00
|
|
|
end
|
2019-02-11 17:22:35 -05:00
|
|
|
end
|