Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # gem install goliath
- # ruby myapp.rb -sv
- require 'goliath'
- class Echo < Goliath::API
- use Goliath::Rack::Params
- use Goliath::Rack::Validation::RequiredParam, {:key => 'delay'}
- def response(env)
- EM::Synchrony.sleep params['delay']
- [200, {}, params['delay']]
- end
- end
Add Comment
Please, Sign In to add comment