I’m proud to announce the initial release of Roda, a new ruby web
framework based on the following ideas:
- Use a routing tree, similar to Cuba and Rum
- Make it easy to use like Sinatra
- Make it extensible like Sequel
- Avoid namespace pollution
Here’s some sample code to get a flavor:
cat config.ru
require “roda”
class App < Roda
use Rack::Session::Cookie, secret: ENV[‘SECRET’]
route do |r|
# matches any GET request
r.get do
# matches GET /
r.is "" do
r.redirect "/hello"
end
# matches GET /hello or GET /hello/.*
r.on "hello" do
# matches GET /hello/world
r.is "world" do
"Hello world!"
end
# matches GET /hello
r.is do
"Hello!"
end
end
end
end
end
run App.app
Find out more about why Roda was created at
http://roda.jeremyevans.net/why.html
Thanks,
Jeremy