Change structure

This commit is contained in:
Mirai Kumiko 2025-07-01 10:15:06 +02:00
parent 01c2c57933
commit ddfb58c041
Signed by: miraikumiko
GPG key ID: 3F178B1B5E0CB278
16 changed files with 153 additions and 66 deletions

View file

@ -6,8 +6,8 @@ defmodule NullaWeb.Router do
plug :fetch_session
plug :fetch_live_flash
plug :put_root_layout, html: {NullaWeb.Layouts, :root}
# plug :protect_from_forgery
# plug :put_secure_browser_headers
plug :protect_from_forgery
plug :put_secure_browser_headers
end
pipeline :api do
@ -18,16 +18,11 @@ defmodule NullaWeb.Router do
plug :accepts, ["activity+json"]
end
scope "/", NullaWeb do
scope "/", NullaWeb.Web, as: :web do
pipe_through :browser
get "/", PageController, :home
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
scope "/auth" do
post "/", AuthController, :sign_up
post "/sign_in", AuthController, :sign_in
@ -38,21 +33,24 @@ defmodule NullaWeb.Router do
scope "/@:username" do
get "/", ActorController, :show
get "/following", FollowController, :following
get "/followers", FollowController, :followers
post "/inbox", InboxController, :inbox
get "/outbox", OutboxController, :outbox
get "/:id", NoteController, :show
end
end
scope "/api", NullaWeb do
scope "/api", NullaWeb.Api, as: :api do
pipe_through :api
resources "/notes", NoteController
end
scope "/", NullaWeb do
scope "/", NullaWeb.ActivityPub, as: :activitypub do
pipe_through :activitypub
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
post "/inbox", InboxController, :inbox
scope "/users/:username" do