46 lines
1.1 KiB
Elixir
46 lines
1.1 KiB
Elixir
|
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
|
||
|
plug BasicAuth, use_config: {:frenzy, :auth}
|
||
|
end
|
||
|
|
||
|
pipeline :api do
|
||
|
plug :accepts, ["json"]
|
||
|
|
||
|
end
|
||
|
|
||
|
scope "/", FrenzyWeb do
|
||
|
pipe_through :browser
|
||
|
|
||
|
# get "/", PageController, :index
|
||
|
|
||
|
get "/", FeedController, :index
|
||
|
resources "/feeds", FeedController, except: [:edit, :update]
|
||
|
post "/feeds/:id/refresh", FeedController, :refresh
|
||
|
|
||
|
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
|