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



18
19
20
21
22
23
# File 'lib/herbert/Jsonify.rb', line 18

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