Sha256: 4dd810c60f5f74cef6c6ee6269ede32017dca44b20a3626b16795b3792f123c9

Contents?: true

Size: 373 Bytes

Versions: 9

Compression:

Stored size: 373 Bytes

Contents

#!/usr/bin/env ruby
$:<< '../lib' << 'lib'

require 'goliath/api'
require 'goliath/runner'

# Example demonstrating how to use a custom Goliath runner
#

class Custom < Goliath::API
  def response(env)
    [200, {}, "hello!"]
  end
end

runner = Goliath::Runner.new(ARGV, nil)
runner.api = Custom.new
runner.app = Goliath::Rack::Builder.build(Custom, runner.api)
runner.run

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
goliath-1.0.7 examples/custom_server.rb
goliath-1.0.6 examples/custom_server.rb
goliath-1.0.5 examples/custom_server.rb
goliath-1.0.4 examples/custom_server.rb
goliath-1.0.3 examples/custom_server.rb
goliath-1.0.2 examples/custom_server.rb
goliath-1.0.1 examples/custom_server.rb
goliath-1.0.0 examples/custom_server.rb
goliath-1.0.0.beta.1 examples/custom_server.rb