This commit is contained in:
Mirai Kumiko 2025-07-05 15:20:40 +02:00
parent 188bc08494
commit 4af88f3e1d
Signed by: miraikumiko
GPG key ID: 3F178B1B5E0CB278
44 changed files with 1041 additions and 34 deletions

View file

@ -18,13 +18,17 @@ defmodule NullaWeb.Router do
plug :fetch_api_user
end
pipeline :activitypub do
plug :accepts, ["activity+json"]
end
scope "/", NullaWeb do
pipe_through :browser
get "/", PageController, :home
end
scope "/api", NullaWeb do
scope "/api", NullaWeb.Api, as: :api do
pipe_through :api
resources "/actors", ActorController, except: [:new, :edit]
@ -34,6 +38,28 @@ defmodule NullaWeb.Router do
resources "/activities", ActivityController, except: [:new, :edit]
end
scope "/", NullaWeb.ActivityPub, as: :activitypub 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, :index
get "/notes/:id", NoteController, :show
end
end
scope "/", NullaWeb.Generic, as: :generic do
get "/.well-known/host-meta", HostmetaController, :index
get "/.well-known/webfinger", WebfingerController, :index
get "/.well-known/nodeinfo", NodeinfoController, :index
get "/nodeinfo/2.0", NodeinfoController, :show
end
# Enable LiveDashboard and Swoosh mailbox preview in development
if Application.compile_env(:nulla, :dev_routes) do
# If you want to use the LiveDashboard in production, you should put