Sha256: 65b953a05068e3f2b134570888ddb05e70b6e475f9784b3c34f3a44cc82c9d29

Contents?: true

Size: 622 Bytes

Versions: 1

Compression:

Stored size: 622 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" || ARGV[0]

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: StatsLite.configure.port)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
stats_lite-0.6.0 exe/stats-lite