class Mail2cb::Handler

Public Class Methods

new() click to toggle source
# File lib/mail2cb.rb, line 17
def initialize
  @@watcher = EmailWatcher.new

  @@watcher.start
  Thread.abort_on_exception = true

  my_app = Sinatra.new do
    set :logging, false
    set :run, false
    set :bind, '0.0.0.0'

    get('/reload') do
      @@watcher.restart
      "OK"
    end

  end
  my_app.run!
end