Created
February 3, 2011 20:57
-
-
Save kennystone/810182 to your computer and use it in GitHub Desktop.
em/sinatra example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'sinatra/base' | |
require 'eventmachine' | |
require 'thin' | |
EventMachine.run do | |
class Dude < Sinatra::Base | |
get '/' do | |
'oh hai' | |
end | |
end | |
EventMachine.add_periodic_timer(5) { puts Time.now.to_s } | |
Dude.run!( :port=>4567 ) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment