Sha256: 3502aea9c661e9289377ac640db9d50fbf671c7b68761853d12915eabd6163fe

Contents?: true

Size: 327 Bytes

Versions: 60

Compression:

Stored size: 327 Bytes

Contents

require 'twiglet/logger'
require 'request_logger'

# basic rack application
class Application
  def call(_env)
    status  = 200
    headers = { "Content-Type" => "text/json" }
    body    = ["Example rack app"]

    [status, headers, body]
  end
end

use RequestLogger, Twiglet::Logger.new('example_app')

run Application.new

Version data entries

60 entries across 60 versions & 1 rubygems

Version Path
twiglet-3.13.5 examples/rack/example_rack_app.rb
twiglet-3.13.4 examples/rack/example_rack_app.rb
twiglet-3.13.0 examples/rack/example_rack_app.rb
twiglet-3.12.0 examples/rack/example_rack_app.rb
twiglet-3.11.0 examples/rack/example_rack_app.rb
twiglet-3.10.0 examples/rack/example_rack_app.rb
twiglet-3.9.2 examples/rack/example_rack_app.rb
twiglet-3.9.1 examples/rack/example_rack_app.rb
twiglet-3.9.0 examples/rack/example_rack_app.rb
twiglet-3.8.0 examples/rack/example_rack_app.rb
twiglet-3.7.2 examples/rack/example_rack_app.rb
twiglet-3.7.1 examples/rack/example_rack_app.rb
twiglet-3.7.0 examples/rack/example_rack_app.rb
twiglet-3.6.6 examples/rack/example_rack_app.rb
twiglet-3.6.5 examples/rack/example_rack_app.rb
twiglet-3.6.4 examples/rack/example_rack_app.rb
twiglet-3.6.3 examples/rack/example_rack_app.rb
twiglet-3.6.2 examples/rack/example_rack_app.rb
twiglet-3.6.1 examples/rack/example_rack_app.rb
twiglet-3.6.0 examples/rack/example_rack_app.rb