Update routes
This commit is contained in:
parent
2cfc459cd0
commit
88b8b379e7
2 changed files with 24 additions and 16 deletions
|
@ -2,7 +2,7 @@ defmodule NullaWeb.Router do
|
|||
use NullaWeb, :router
|
||||
|
||||
pipeline :browser do
|
||||
plug :accepts, ["html", "json", "activity+json", "ld+json"]
|
||||
plug :accepts, ["html", "json", "activity+json"]
|
||||
plug :fetch_session
|
||||
plug :fetch_live_flash
|
||||
plug :put_root_layout, html: {NullaWeb.Layouts, :root}
|
||||
|
@ -14,6 +14,10 @@ defmodule NullaWeb.Router do
|
|||
plug :accepts, ["json"]
|
||||
end
|
||||
|
||||
pipeline :activitypub do
|
||||
plug :accepts, ["activity+json"]
|
||||
end
|
||||
|
||||
scope "/", NullaWeb do
|
||||
pipe_through :browser
|
||||
|
||||
|
@ -23,7 +27,6 @@ defmodule NullaWeb.Router do
|
|||
get "/.well-known/webfinger", WebfingerController, :index
|
||||
get "/.well-known/nodeinfo", NodeinfoController, :index
|
||||
get "/nodeinfo/2.0", NodeinfoController, :show
|
||||
post "/inbox", InboxController, :inbox
|
||||
|
||||
scope "/auth" do
|
||||
post "/", AuthController, :sign_up
|
||||
|
@ -33,15 +36,6 @@ defmodule NullaWeb.Router do
|
|||
get "/sign_in", PageController, :sign_in
|
||||
end
|
||||
|
||||
scope "/users/:username" do
|
||||
get "/", ActorController, :show
|
||||
get "/following", FollowController, :following
|
||||
get "/followers", FollowController, :followers
|
||||
post "/inbox", InboxController, :inbox
|
||||
get "/outbox", OutboxController, :outbox
|
||||
get "/notes/:id", NoteController, :show
|
||||
end
|
||||
|
||||
scope "/@:username" do
|
||||
get "/", ActorController, :show
|
||||
get "/following", FollowController, :following
|
||||
|
@ -52,10 +46,24 @@ defmodule NullaWeb.Router do
|
|||
end
|
||||
end
|
||||
|
||||
# Other scopes may use custom stacks.
|
||||
# scope "/api", NullaWeb do
|
||||
# pipe_through :api
|
||||
# end
|
||||
scope "/api", NullaWeb do
|
||||
pipe_through :api
|
||||
end
|
||||
|
||||
scope "/", NullaWeb do
|
||||
pipe_through :activitypub
|
||||
|
||||
post "/inbox", InboxController, :inbox
|
||||
|
||||
scope "/users/:username" do
|
||||
get "/", ActorController, :show
|
||||
get "/following", FollowController, :following
|
||||
get "/followers", FollowController, :followers
|
||||
post "/inbox", InboxController, :inbox
|
||||
get "/outbox", OutboxController, :outbox
|
||||
get "/notes/:id", NoteController, :show
|
||||
end
|
||||
end
|
||||
|
||||
# Enable LiveDashboard and Swoosh mailbox preview in development
|
||||
if Application.compile_env(:nulla, :dev_routes) do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue