Sha256: 45695f8a9a31d90eae05a2c4ce61d8b4a152348563dacaf64ae41d021cc5c26f

Contents?: true

Size: 357 Bytes

Versions: 1

Compression:

Stored size: 357 Bytes

Contents

# frozen_string_literal: true

require 'bundler/setup'
require 'polyphony/http/server'

opts = {
  reuse_addr:  true,
  dont_linger: true
}

spin do
  Polyphony::HTTP::Server.serve('0.0.0.0', 1234, opts) do |req|
    req.respond("Hello world!\n")
  rescue Exception => e
    p e
  end
end

puts "pid: #{Process.pid}"
puts 'Listening on port 1234...'
suspend

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
polyphony-http-0.28 examples/http_server.rb