Sha256: 1618a0061b2ed6227f142bcca9cde31e80432faef702f4aa89d97ab9dcac5a09

Contents?: true

Size: 647 Bytes

Versions: 15

Compression:

Stored size: 647 Bytes

Contents

require 'rack/conneg'
require 'rack/tracker'

module <%= @gen.camelname %>
  class App < Sinatra::Base
    set :public_folder, 'public'
    set :views, 'views'

    if CONFIG['google-analytics-tag']
      use Rack::Tracker do
        handler :google_analytics, { tracker: CONFIG['google-analytics-tag'] }
      end
    end

    use Rack::Conneg do |conneg|
      conneg.set :accept_all_extensions, true
      conneg.set :fallback, :html
      conneg.ignore_contents_of 'public'
      conneg.provide [
        :html,
        :json
      ]
    end

    before do
      if negotiated?
        content_type negotiated_type
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
skellington-0.9.0.pre.rc1 lib/templates/sinatra/lib/app/racks.rb
skellington-0.8.9 lib/templates/sinatra/lib/app/racks.rb
skellington-0.8.8 lib/templates/sinatra/lib/app/racks.rb
skellington-0.8.7 lib/sinatra/templates/lib/app/racks.rb
skellington-0.8.6 lib/sinatra/templates/lib/app/racks.rb
skellington-0.8.5 lib/sinatra/templates/lib/app/racks.rb
skellington-0.8.4 lib/sinatra/templates/lib/app/racks.rb
skellington-0.8.3 lib/sinatra/templates/lib/app/racks.rb.eruby
skellington-0.8.2 lib/sinatra/templates/lib/app/racks.rb.eruby
skellington-0.8.1 lib/sinatra/templates/lib/app/racks.rb.eruby
skellington-0.8.0 lib/sinatra/templates/lib/app/racks.rb.eruby
skellington-0.7.5 lib/templates/lib/app/racks.rb.eruby
skellington-0.7.4 lib/templates/lib/app/racks.rb.eruby
skellington-0.7.3 lib/templates/lib/app/racks.rb.eruby
skellington-0.7.2 lib/templates/lib/app/racks.rb.eruby