mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-12-18 07:48:19 +00:00
Add basic config endpoint.
This commit is contained in:
parent
1b086834bd
commit
129e30f465
|
@ -25,6 +25,7 @@ defmodule Pleroma.Web.Router do
|
||||||
get "/statuses/public_and_external_timeline", TwitterAPI.Controller, :public_timeline
|
get "/statuses/public_and_external_timeline", TwitterAPI.Controller, :public_timeline
|
||||||
get "/statuses/show/:id", TwitterAPI.Controller, :fetch_status
|
get "/statuses/show/:id", TwitterAPI.Controller, :fetch_status
|
||||||
get "/statusnet/conversation/:id", TwitterAPI.Controller, :fetch_conversation
|
get "/statusnet/conversation/:id", TwitterAPI.Controller, :fetch_conversation
|
||||||
|
get "/statusnet/config", TwitterAPI.Controller, :config
|
||||||
end
|
end
|
||||||
|
|
||||||
scope "/api", Pleroma.Web do
|
scope "/api", Pleroma.Web do
|
||||||
|
|
|
@ -83,6 +83,20 @@ defmodule Pleroma.Web.TwitterAPI.Controller do
|
||||||
|> send_resp(200, response)
|
|> send_resp(200, response)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def config(conn, _params) do
|
||||||
|
response = %{
|
||||||
|
site: %{
|
||||||
|
name: Pleroma.Web.base_url,
|
||||||
|
server: Pleroma.Web.base_url,
|
||||||
|
textlimit: -1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|> Poison.encode!
|
||||||
|
|
||||||
|
conn
|
||||||
|
|> json_reply(200, response)
|
||||||
|
end
|
||||||
|
|
||||||
defp json_reply(conn, status, json) do
|
defp json_reply(conn, status, json) do
|
||||||
conn
|
conn
|
||||||
|> put_resp_content_type("application/json")
|
|> put_resp_content_type("application/json")
|
||||||
|
|
Loading…
Reference in a new issue