1
0
mirror of https://github.com/mgerb/classic-wow-forums synced 2026-01-12 18:12:48 +00:00
Files
classic-wow-forums/lib/myapp_web/router.ex

49 lines
1009 B
Elixir

defmodule MyAppWeb.Router do
use MyAppWeb, :router
alias MyApp.Guardian.AuthPipeline
pipeline :api do
plug :accepts, ["json"]
end
pipeline :api_auth do
plug AuthPipeline.JSON
end
# Other scopes may use custom stacks.
scope "/api", MyAppWeb do
pipe_through [:api]
scope "/battlenet" do
get "/authorize", BattleNetController, :authorize
pipe_through [:api_auth]
get "/characters", BattleNetController, :characters
end
scope "/user" do
# authenticated routes
pipe_through [:api_auth]
get "/", UserController, :index
end
scope "/thread" do
# authenticated routes
pipe_through [:api_auth]
post "/", ThreadController, :insert
put "/", ThreadController, :update
end
scope "reply" do
# authenticated routes
pipe_through [:api_auth]
post "/", ReplyController, :insert
end
scope "/category" do
get "/", CategoryController, :get_collection
end
end
end