Skip to content

Instantly share code, notes, and snippets.

@Linell
Created February 7, 2018 15:35
Show Gist options
  • Save Linell/1dc1c7566dbbc2259620405c221bf0f0 to your computer and use it in GitHub Desktop.
Save Linell/1dc1c7566dbbc2259620405c221bf0f0 to your computer and use it in GitHub Desktop.
Sidekiq Web UI
require 'rubygems'
require 'bundler'
Bundler.require
$: << File.expand_path('../', __FILE__)
$: << File.expand_path('../lib', __FILE__)
require 'active_support'
require 'active_support/core_ext'
require 'app/controllers'
require 'app/models'
require 'app/services'
require 'app/workers'
require 'app/lib/exceptions'
require 'config/database'
module Scrunchie
class App < Sinatra::Application
configure do
disable :method_override
disable :static
set :show_exceptions, :after_handler
end
# Warden Configuration {{{
# -----------------------------------------------------------------------------
# There's some configuration here, but it doesn't seem to be related because
# removing this doesn't affect anything.
# }}}
use Rack::Deflater
use Controllers::Status
use Controllers::Query
end
end
include Scrunchie::Models
include Scrunchie::Services
include Scrunchie::Workers
require './app'
require 'dotenv/load'
require 'sidekiq'
require 'sidekiq/web'
# Sidekiq Web Interface {{{
# ---------------------------------------------------------------------------------
# I had basic auth stuff here, like you'd see in the README. It's been removed and
# still no dice.
# }}}
run Rack::URLMap.new('/' => Scrunchie::App, '/sidekiq' => Sidekiq::Web)
web: bundle exec puma -t 4:16 config.ru -p $PORT
worker: bundle exec sidekiq -r ./app.rb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment