nodeinfo_controller.rb 598 B

12345678910111213141516171819
  1. # frozen_string_literal: true
  2. module WellKnown
  3. class NodeInfoController < ActionController::Base
  4. include CacheConcern
  5. before_action { response.headers['Vary'] = 'Accept' }
  6. def index
  7. expires_in 3.days, public: true
  8. render_with_cache json: {}, serializer: NodeInfo::DiscoverySerializer, adapter: NodeInfo::Adapter, expires_in: 3.days, root: 'nodeinfo'
  9. end
  10. def show
  11. expires_in 30.minutes, public: true
  12. render_with_cache json: {}, serializer: NodeInfo::Serializer, adapter: NodeInfo::Adapter, expires_in: 30.minutes, root: 'nodeinfo'
  13. end
  14. end
  15. end