Gem Rails like Sinatra.
Mini Rails is a fun-hack that tweaks Rails routing allowing defining actions in simples route definitions like match/get blocks. So it's Rails but feels like Sinatra.
require './lib/rails_mini'
app = Rails.mini do
config.secret_token = '!*#&$' * 31
get '/hello' do
render text: "Hello #{params[:to]}!"
end
get '/ping' do
render json: {'ping' => 'pong'}
end
end
run app
gem install rails-mini
See example
[x] Better defaults
[/] Sinatra DSL
[X] block dsl in router
[X] block dsl behaviours like controller action
[X] render
[X] redirect
[ ]
[ ] real world usage
[ ] example app
- sinatra
- astaire