module Roda::RodaPlugins::Json

def self.configure(app, opts=OPTS)

Set the classes to automatically convert to JSON, and the serializer to use.
def self.configure(app, opts=OPTS)
  classes = opts[:classes] || [Array, Hash]
  app.opts[:json_result_classes] ||= []
  app.opts[:json_result_classes] += classes
  app.opts[:json_result_classes].uniq!
  app.opts[:json_result_classes].freeze
  app.opts[:json_result_serializer] = opts[:serializer] || app.opts[:json_result_serializer] || app.opts[:json_serializer] || :to_json.to_proc
  app.opts[:json_result_include_request] = opts[:include_request] if opts.has_key?(:include_request)
  app.opts[:json_result_content_type] = opts[:content_type] || 'application/json'.freeze
end