Created
March 26, 2011 22:50
-
-
Save mostlyobvious/888708 to your computer and use it in GitHub Desktop.
This file contains 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
# 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