peers_controller.rb 368 B

1234567891011121314151617
  1. # frozen_string_literal: true
  2. class Api::V1::Instances::PeersController < Api::BaseController
  3. before_action :require_enabled_api!
  4. respond_to :json
  5. def index
  6. render_cached_json('api:v1:instances:peers:index', expires_in: 1.day) { Account.remote.domains }
  7. end
  8. private
  9. def require_enabled_api!
  10. head 404 unless Setting.peers_api_enabled
  11. end
  12. end