Created
December 11, 2010 05:27
-
-
Save ahawkins/737173 to your computer and use it in GitHub Desktop.
resque web server + rack + rails 2 + bundler
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'logger' | |
require 'rubygems' | |
require 'config/environment' | |
require 'resque/server' | |
# Set the RESQUECONFIG env variable if you've a `resque.rb` or similar | |
# config file you want loaded on boot. | |
load ::File.expand_path(File.join(File.dirname(__FILE__), "config", "initializers", "resque.rb")) | |
# Set the AUTH env variable to your basic auth password to protect Resque. | |
AUTH_PASSWORD = ENV['AUTH'] | |
if AUTH_PASSWORD | |
Resque::Server.use Rack::Auth::Basic do |username, password| | |
password == AUTH_PASSWORD | |
end | |
end | |
run Rack::URLMap.new \ | |
"/" => ActionController::Dispatcher.new, | |
"/resque" => Resque::Server.new |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment