Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

37 lines (30 sloc) 0.938 kb
# Example mongrel harness for camping apps with rv
#
# author: Evan Weaver
# url: http://blog.evanweaver.com/articles/2006/12/19/rv-a-tool-for-luxurious-camping
# license: AFL 3.0
require 'rubygems'
require 'mongrel'
require 'mongrel/camping'
LOGFILE = 'mongrel.log'
PIDFILE = 'mongrel.pid'
# or whatever else you want passed in
PORT = 3302
ADDR = "0.0.0.0"
# this is your camping app
require 'twifter'
app = Twifter
app.create
config = Mongrel::Configurator.new :host => ADDR, :pid_file => PIDFILE do
listener :port => PORT do
uri '/', :handler => Mongrel::Camping::CampingHandler.new(app)
# use the mongrel static server in production instead of the camping controller
uri '/static/', :handler => Mongrel::DirHandler.new("static/")
uri '/favicon.ico', :handler => Mongrel::Error404Handler.new('')
setup_signals
run
write_pid_file
log "#{app} available at #{ADDR}:#{PORT}"
join
end
end
Jump to Line
Something went wrong with that request. Please try again.