clacks/lib/clacks_web/router.ex

37 lines
808 B
Elixir
Raw Normal View History

2019-09-28 22:30:55 +00:00
defmodule ClacksWeb.Router do
use ClacksWeb, :router
pipeline :browser do
plug :accepts, ["html"]
plug :fetch_session
plug :fetch_flash
plug :protect_from_forgery
plug :put_secure_browser_headers
end
2019-09-29 01:57:11 +00:00
pipeline :activitypub do
plug :accepts, ["activity+json", "html"]
2019-09-28 22:30:55 +00:00
end
scope "/", ClacksWeb do
pipe_through :browser
end
2019-09-29 01:57:11 +00:00
scope "/", ClacksWeb do
pipe_through :activitypub
get "/objects/:id", ObjectsController, :get
2019-10-01 02:26:08 +00:00
get "/users/:nickname", ActorController, :get
2019-10-01 16:35:27 +00:00
2019-10-01 22:39:17 +00:00
post "/inbox", InboxController, :shared
post "/users/:nickname/inbox", InboxController, :user_specific
2019-10-01 16:35:27 +00:00
get "/.well-known/webfinger", WebFingerController, :get
2019-09-29 01:57:11 +00:00
end
2019-09-28 22:30:55 +00:00
# Other scopes may use custom stacks.
# scope "/api", ClacksWeb do
# pipe_through :api
# end
end