ry / ebb fork watch download tarball
public
Description: web server
Homepage: http://ebb.rubyforge.org
Clone URL: git://github.com/ry/ebb.git
Ryan Dahl (author)
Thu Mar 06 08:17:42 -0800 2008
commit  9b05bbd9644cc6bbdd4f845196a715f21d91fbb2
tree    1c8e228362031077337ea044e521b56df8befb59
parent  98ceeb9fbacb61dd7dc61847d4c88f97420cddef
ebb / test / echo_server.rb
100644 17 lines (12 sloc) 0.339 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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::Server.new(EchoApp.new, :port => 4037)
server.start