Sinatra JSON output

Yesterday i needed some quick and dirty JSON output using Sinatra, ‘cause I was studying how HTTP requests works in iOS. To create JSON response with Sinatra, just do something like that:

get "/" do
  content_type :json, 'presidents.json'))

You might also like


I am open sourcing a project that I have been using a lot lately. You can easily define routes and some rules...

Comparison between Rack, Sinatra and Webmachine

Benchmarking Ruby and Erlang

Healthyr - Rails app performance monitor

Open sourcing a lib I created to benchmark Rails apps, using ActiveSupport::Notifications

Learning a new framework from scratch is hard

You invested thousands of hours learning Rails and how to master its features to build web applications. This book will help you to learn Phoenix, using the knowledge you already have.

Get the book