Sha256: f9e15cc1a9413499aa8b4bc7099972b12dd2e0592f6792d797a13cbef0f2bba2
Contents?: true
Size: 678 Bytes
Versions: 9
Compression:
Stored size: 678 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 http://#{addr}:#{port}" Reel::Server::HTTP.run(addr, port, spy: true) 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!\n" 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
9 entries across 9 versions & 1 rubygems