Guest User

Untitled

a guest
Jan 21st, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. # gem install goliath
  2. # ruby myapp.rb -sv
  3.  
  4. require 'goliath'
  5.  
  6. class Echo < Goliath::API
  7.  
  8. use Goliath::Rack::Params
  9. use Goliath::Rack::Validation::RequiredParam, {:key => 'delay'}
  10.  
  11. def response(env)
  12. EM::Synchrony.sleep params['delay']
  13.  
  14. [200, {}, params['delay']]
  15. end
  16.  
  17. end
Add Comment
Please, Sign In to add comment