Refactored utility actions

This commit is contained in:
dtluna 2017-05-13 04:22:51 +03:00
parent 6e66de0fae
commit bfe628ebaa
2 changed files with 20 additions and 2 deletions

View File

@ -26,8 +26,8 @@ defmodule Pleroma.Web.Router do
scope "/api", Pleroma.Web do
pipe_through :api
get "/help/test", TwitterAPI.Controller, :help_test
get "/statusnet/config", TwitterAPI.Controller, :config
get "/help/test", TwitterAPI.UtilController, :help_test
get "/statusnet/config", TwitterAPI.UtilController, :config
get "/statuses/public_timeline", TwitterAPI.Controller, :public_timeline
get "/statuses/public_and_external_timeline", TwitterAPI.Controller, :public_and_external_timeline

View File

@ -0,0 +1,18 @@
defmodule Pleroma.Web.TwitterAPI.UtilController do
use Pleroma.Web, :controller
alias Pleroma.Web
def help_test(conn, _params) do
json conn, "ok"
end
def config(conn, _params) do
json conn, %{
site: %{
name: Web.base_url,
server: Web.base_url,
textlimit: -1
}
}
end
end