Skip to content

Instantly share code, notes, and snippets.

@brianjlandau
Created October 27, 2010 23:54
Show Gist options
  • Select an option

  • Save brianjlandau/650274 to your computer and use it in GitHub Desktop.

Select an option

Save brianjlandau/650274 to your computer and use it in GitHub Desktop.
A piece of Rails metal that allows you to run the Resque web server as part of the application.
# app/metal/resque_web.rb
# Allow the metal piece to run in isolation
require(File.dirname(__FILE__) + "/../../config/environment") unless defined?(Rails)
require 'resque/server'
Resque::Server.use Rack::Auth::Basic do |username, password|
username == 'admin' && password == 'password'
end
ResqueWeb = Rack::URLMap.new("/resque" => Resque::Server.new)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment