Sha256: 0c1b49a397c9c26b2be3df3d24a8c88c86d1f0dc8a0ea7e713739f17a2254fd3

Contents?: true

Size: 756 Bytes

Versions: 8

Compression:

Stored size: 756 Bytes

Contents

class MyApp < Sinatra::Application
  use Rack::Session::EncryptedCookie,
    secret: 'supersecretcookiefromgenerator'

  set :app_file, __FILE__
  set :server, :puma
  set :views, Proc.new { File.join(root, "app/views") }
  set :assets, Sprockets::Environment.new
  set :assets_manifest, %w(app.js app.css)
  use Rack::Csrf, raise: true

  configure do
    assets.append_path 'assets/stylesheets'
    assets.append_path 'assets/javascripts'
  end

  configure :development do
    get '/assets/*' do
      env['PATH_INFO'].sub!('/assets', '')
      settings.assets.call(env)
    end
  end

  configure :production do
    # Serve assets via Nginx or Apache
    disable :static

    assets.js_compressor  = :uglify
    assets.css_compressor = :sass
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
sinator-4.0.0 spec/fixtures/without_db/app.txt
sinator-3.1.1 spec/fixtures/without_db/app.txt
sinator-3.1.0 spec/fixtures/without_db/app.txt
sinator-3.0.4 spec/fixtures/without_db/app.txt
sinator-3.0.3 spec/fixtures/without_db/app.txt
sinator-3.0.2 spec/fixtures/without_db/app.txt
sinator-3.0.1 spec/fixtures/without_db/app.txt
sinator-3.0.0 spec/fixtures/without_db/app.txt