Skip to content

Instantly share code, notes, and snippets.

@ddrscott
Created May 10, 2018 15:17
Show Gist options
  • Save ddrscott/e465d6f078ed8a27c320e5a258c67e98 to your computer and use it in GitHub Desktop.
Save ddrscott/e465d6f078ed8a27c320e5a258c67e98 to your computer and use it in GitHub Desktop.
Standalone Sidekiq Web Server
#!/usr/bin/env ruby
# Run Sidekiq Web Standalone
require 'rack'
require 'sidekiq'
require 'sidekiq-ent'
require 'sidekiq-pro'
Sidekiq.configure_client do |config|
config.redis = { :size => 1 }
end
require 'sidekiq/web'
Rack::Handler::WEBrick.run Sidekiq::Web
@ddrscott
Copy link
Author

This is to avoid waiting for an entire Rails server to startup just to peek at some worker activity.

# save the contents of this file or manually copy/paste.
curl https://gist.githubusercontent.com/ddrscott/e465d6f078ed8a27c320e5a258c67e98/raw/fd88f238a52a4ee54bed99ec637bf3a85876023f/sidekiq_web > sidekiq_web

# run it
ruby sidekiq_web

# open browser to the site
open http://localhost:8080

# **or** make it executable
chmod +x sidekiq_web

# run it
./sidekiq_web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment