Sha256: 3599957594b7326af3525a3d423030726fe6c7ef20b18d412374954c00d74eb1

Contents?: true

Size: 652 Bytes

Versions: 6

Compression:

Stored size: 652 Bytes

Contents

#!/usr/bin/env ruby
# Run with: bundle exec examples/hello_world.rb

require 'rubygems'
require 'bundler/setup'
require 'reel'

addr, port = '127.0.0.1', 1234

puts "*** Starting server on #{addr}:#{port}"
Reel::Server.run(addr, port) do |connection|
  # For keep-alive support
  connection.each_request do |request|
    # Ordinarily we'd route the request here, e.g.
    # route request.url
    request.respond :ok, "hello, world!"
  end

  # Reel takes care of closing the connection for you
  # If you would like to hand the connection off to another thread or actor,
  # use, connection.detach and then manually call connection.close when done
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
reel-0.4.0 examples/hello_world.rb
reel-0.4.0.pre7 examples/hello_world.rb
reel-0.4.0.pre6 examples/hello_world.rb
reel-0.4.0.pre5 examples/hello_world.rb
reel-0.4.0.pre4 examples/hello_world.rb
reel-0.4.0.pre3 examples/hello_world.rb