1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2021 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 plug(Pleroma.Web.ApiSpec.CastAndValidate)
12 defdelegate open_api_operation(action), to: Pleroma.Web.ApiSpec.PleromaInstancesOperation
14 def show(conn, _params) do
16 Instances.get_consistently_unreachable()
17 |> Map.new(fn {host, date} -> {host, to_string(date)} end)
19 json(conn, %{"unreachable" => unreachable})