require 'logger' require 'sequel' require 'sqlite3' require 'sinatra' require 'sinatra/namespace' require_relative 'lib/config.rb' set :public_folder, __dir__ + '/public' set :views, settings.root + '/views' # Load configuration file conf = Config.new(File.join(__dir__, 'data/defaults.yaml')) # Initialize logging logger = Logger.new(STDOUT) logger.level = Logger::INFO # Load the Sequel timestamps plugin Sequel::Model.plugin :timestamps # Initialize Sequel gem for database actions DB = Sequel.connect(adapter: conf.get('database.adapter'), database: conf.get('database.database')) # Load models require_relative 'lib/models/item.rb' require_relative 'lib/models/item_comment.rb' require_relative 'lib/models/license.rb' require_relative 'lib/models/license_comment.rb' # Load helper functions require_relative 'lib/helpers.rb' # Register route handlers require_relative 'lib/routes.rb'