ry / ebb fork watch download tarball
public
Description: web server
Homepage: http://ebb.rubyforge.org
Clone URL: git://github.com/ry/ebb.git
ebb / test / echo_server.rb
100644 16 lines (11 sloc) 0.344 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
require 'rubygems'
require 'json'
require File.dirname(__FILE__) + '/../ruby_lib/ebb'
 
 
class EchoApp
  def call(env)
    env['rack.input'] = env['rack.input'].read(1000000)
    env.delete('rack.errors')
    [200, {'Content-Type' => 'text/json'}, env.to_json]
  end
end
 
 
server = Ebb::start_server(EchoApp.new, :port => 4037, :workers => 10)