Skip to content

Instantly share code, notes, and snippets.

@charger
Last active December 20, 2015 02:09
Show Gist options
  • Save charger/6053943 to your computer and use it in GitHub Desktop.
Save charger/6053943 to your computer and use it in GitHub Desktop.
require File.expand_path(File.join(File.dirname(__FILE__),'..', 'config', 'environment'))
require 'evma_httpserver'
class HttpServer < EventMachine::Connection
include EventMachine::HttpServer
def process_http_request
@content = Rack::Utils.parse_query(@http_post_content)
#or СGI.parse
end
end
EventMachine.run {
EventMachine.start_server('0.0.0.0', 3001, HttpServer)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment