config.ru 535 B

123456789101112131415161718192021222324252627
  1. # frozen_string_literal: true
  2. # sharable_constant_value: litera
  3. require 'bundler'
  4. Bundler.require
  5. require 'rack/protection'
  6. require 'rack-timeout'
  7. require 'sinatra'
  8. require_relative 'app/bgplookup'
  9. require_relative 'lib/config/config'
  10. $Config = Config.from_file('config.json')
  11. $DB = $Config.db
  12. $Logger = $Config.logger
  13. Rack::Timeout::Logger.disable
  14. use Rack::Timeout, service_timeout: 30
  15. use Rack::Protection, except: :session_hijacking
  16. require_relative 'lib/readers/helper'
  17. $Readers = Readers.create_readers $DB
  18. run BgpLookup