Created
September 25, 2010 16:17
-
-
Save morten/597004 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
require 'rubygems' | |
require 'eventmachine' | |
require 'evma_httpserver' | |
module Simpleton | |
include EventMachine::HttpServer | |
def self.run | |
EventMachine::run do | |
EventMachine::start_server('0.0.0.0', 9000, self) | |
end | |
end | |
def process_http_request | |
response = EventMachine::DelegatedHttpResponse.new(self) | |
response.status = 200 | |
response.headers['Content-Type'] = 'text/plain' | |
response.content = "Hello\n" | |
response.send_response | |
end | |
end | |
Simpleton.run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment