Module: Sinatra::Jsonify

Defined in:
lib/herbert/Jsonify.rb

Overview

Makes JSON the default DDL of HTTP communication

Class Method Summary collapse

Class Method Details

.registered(app) ⇒ Object

Sinatra inclusion hook



12
13
14
15
16
17
# File 'lib/herbert/Jsonify.rb', line 12

def self.registered(app)
  app.before do
    log.h_debug("Adding proper content-type and charset")
    content_type 'application/json', :charset => 'utf-8'
  end
end