Sinatra (Ruby web DSL)

From: THERE IS NO GOD BUT (RENDLE) 2 Sep 2009 19:16
To: ALL1 of 1
Been having a proper play with this over the last couple of days. It's really incredibly easy to get a web service up and running in a tiny amount of code, and it works very nicely in AppEngine.

For example, a request to get things which required 40-odd lines of Python with the webapp framework, has been rewritten in Ruby/Sinatra as:

ruby code:
get '/things.json' do
  uid = User.authenticate()
  Thing.all(:user_id => uid).map{|t| t.attributes}.to_json
end


Nice.
EDITED: 2 Sep 2009 19:17 by RENDLE