Skip to content

Instantly share code, notes, and snippets.

@morten
Created September 25, 2010 16:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save morten/597004 to your computer and use it in GitHub Desktop.
Save morten/597004 to your computer and use it in GitHub Desktop.
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