Sha256: 3de6fea0740750db79f58ff74392453a310a172b5ed959de971c8e2545e34fd1

Contents?: true

Size: 591 Bytes

Versions: 4

Compression:

Stored size: 591 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|
  # To use keep-alive with Reel, use a while loop that repeatedly calls
  # connection.request and consumes connection objects
  while request = connection.request
    # Ordinarily we'd route the request here, e.g.
    # route request.url
    connection.respond :ok, "hello, world!"
  end

  # Reel takes care of closing the connection
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
reel-0.4.0.pre2 examples/hello_world.rb
reel-0.4.0.pre examples/hello_world.rb
reel-0.3.0 examples/hello_world.rb
reel-0.3.0.pre examples/hello_world.rb