1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Web.PleromaAPI.InstancesController do
6 use Pleroma.Web, :controller
8 alias Pleroma.Instances
10 # defdelegate open_api_operation(action), to: Pleroma.Web.ApiSpec.PleromaInstancesController
12 def show(conn, _params) do
14 Instances.get_consistently_unreachable()
15 |> Enum.reduce(%{}, fn {host, date}, acc -> Map.put(acc, host, to_string(date)) end)
17 json(conn, %{"unreachable" => unreachable})