Change structure
This commit is contained in:
parent
01c2c57933
commit
ddfb58c041
16 changed files with 153 additions and 66 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue