Created
February 16, 2010 12:25
-
-
Save pk/305490 to your computer and use it in GitHub Desktop.
Merb config.ru for Unicorn, Passenger and others
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
begin | |
require ::File.expand_path('.bundle/environment', __FILE__) | |
rescue LoadError | |
require 'rubygems' | |
require 'bundler' | |
Bundler.setup | |
end | |
require 'merb-core' | |
Merb::Config.setup(:merb_root => ::File.expand_path(::File.dirname(__FILE__)), | |
:environment => ENV['RACK_ENV']) | |
Merb::BootLoader.run | |
# use PathPrefix Middleware if :path_prefix is set in Merb::Config | |
if prefix = ::Merb::Config[:path_prefix] | |
use Merb::Rack::PathPrefix, prefix | |
end | |
# comment this out if you are running merb behind a load balancer | |
# that serves static files | |
use Merb::Rack::Static, Merb.dir_for(:public) | |
run Merb::Rack::Application.new |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment