Skip to content

Instantly share code, notes, and snippets.

@mostlyobvious
Created March 26, 2011 22:50
Show Gist options
  • Save mostlyobvious/888708 to your computer and use it in GitHub Desktop.
Save mostlyobvious/888708 to your computer and use it in GitHub Desktop.
# gem install eventmachine eventmachine_httpserver
require 'eventmachine'
require 'evma_httpserver'
module HttpServer
include EM::HttpServer
def process_http_request
response = EM::DelegatedHttpResponse.new(self)
response.status = 200
response.content_type 'text/plain'
response.content = 'ok'
response.send_response
end
end
EM.run do
EM.start_server "localhost", 8000, HttpServer
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment