Sha256: 8291977d5c32216e9cb0e51df7583a1a2021b49e6f57cb389ce4facf15ee3ac7

Contents?: true

Size: 759 Bytes

Versions: 2

Compression:

Stored size: 759 Bytes

Contents

# Copyright (c) 2015 AppNeta, Inc.
# All rights reserved.

# This is a Rack application that is booted in a background
# thread and listens on port 8101.
#
require 'rack/handler/puma'
require 'traceview/inst/rack'

TraceView.logger.info "[traceview/info] Starting background utility rack app on localhost:8101."

Thread.new do
  app = Rack::Builder.new {
    use TraceView::Rack
    map "/" do
      run Proc.new { |env|
        [200, {"Content-Type" => "text/html"}, ['Hello TraceView!']]
      }
    end

    map "/redirectme" do
      run Proc.new { |env|
        [301, {"Location" => "/", "Content-Type" => "text/html"}, ['']]
      }
    end
  }

  Rack::Handler::Puma.run(app, {:Host => '127.0.0.1', :Port => 8101})
end

# Allow Thin to boot.
sleep(2)

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
traceview-3.8.3-java test/servers/rackapp_8101.rb
traceview-3.8.3 test/servers/rackapp_8101.rb