Sha256: 3a3594dd46abfb02dad7a56667acc1a24c40097424238893d3b80cea6cb77501

Contents?: true

Size: 646 Bytes

Versions: 1

Compression:

Stored size: 646 Bytes

Contents

# frozen_string_literal: true

%w[base cookies].each do |filename|
  require "sinatra/#{filename}"
end

%w[tools metrics helpers routes].each do |dirname|
  require_relative "#{dirname}/init"
end

require 'logger'

class Stackeye::Application < Sinatra::Base
  helpers Sinatra::Cookies

  set :app_file, __FILE__
  set :bind, '0.0.0.0'

  configure :development do
    enable :logging, :dump_errors, :raise_errors
  end

  configure :production do
    dir = File.expand_path('log')
    Dir.mkdir(dir) unless File.directory?(dir)
    file = File.new("#{dir}/stackeye.log", 'a+')
    file.sync = true

    use ::Rack::CommonLogger, file
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
stackeye-0.1.0 lib/stackeye/application.rb