Sha256: 880df8b619af142d2220dee9c618dd8bc20c89bb2ce34e0b9349899d6803fb22

Contents?: true

Size: 591 Bytes

Versions: 2

Compression:

Stored size: 591 Bytes

Contents

#!/usr/bin/env ruby
# frozen_string_literal: true

require "stats_lite"
require "rack/handler/puma"
require "filewatcher"

print StatsLite::Log.yellow("\nStarting stats-lite\n")
config = "./config.rb"

load_config = -> do
  if File.exist?(config)
    print StatsLite::Log.red "\nFound config.rb\n"
    load config
  end
end

load_config.call
Thread.new do
  Filewatcher.new(StatsLite.configure.watch).watch do |filename, event|
    load_config.call
  end
end

app = Rack::Builder.new do
  use StatsLite::App
  run lambda { |env| [404, {}, []] }
end

Rack::Handler::Puma.run(app, Port: 3000)

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
stats_lite-0.5.0 exe/stats-lite
stats_lite-0.1.0 exe/stats-lite