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)
Tue Mar 04 07:16:06 -0800 2008
commit  54d1cbf549d79c1e2cc0a82723249eca53ce040e
tree    0683657dd8f0ad11afb246817d868613cc2131f7
parent  38aebaab6cc2ec4144c080a94abfab2cdfd71ade
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