Skip to content

Instantly share code, notes, and snippets.

@mfojtik
Forked from adjohu/config.ru
Created January 13, 2012 11:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mfojtik/1605752 to your computer and use it in GitHub Desktop.
Save mfojtik/1605752 to your computer and use it in GitHub Desktop.
module Rack
class JSON
def initialize app
@app = app
end
def call env
status, headers, body = @app.call env
[status, headers, body.to_json]
end
end
end
use Rack::JSON
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment