postland/lib/postland_web/controllers/webfinger_json.ex

26 lines
634 B
Elixir
Raw Normal View History

defmodule PostlandWeb.WebfingerJSON do
use Phoenix.VerifiedRoutes, endpoint: PostlandWeb.Endpoint, router: PostlandWeb.Router
alias Postland.Accounts
def render("webfinger.json", _assigns) do
user = Accounts.solo_user()
%{
subject: "acct:#{user.username}@#{PostlandWeb.Endpoint.host()}",
links: [
%{
"rel" => "self",
"type" => "application/activity+json",
"href" => url(~p"/actor")
2024-09-30 00:53:00 +00:00
},
%{
"rel" => "http://webfinger.net/rel/profile-page",
"type" =>"text/html",
"href" => url(~p"/about")
}
]
}
end
end