Created
November 12, 2008 19:22
-
-
Save bmizerany/24241 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# RAILS_ROOT/racked.rb | |
require File.dirname(__FILE__) + '/config/environment' | |
require 'thin' | |
# Sinatra stuff | |
require 'tiny' | |
# Make sinatra play nice | |
set :env, :production | |
disable :run, :reload | |
app = Rack::Builder.new { | |
use Rails::Rack::Static | |
# Anything /sin will go to Sinatra | |
map "/tiny" do | |
run Sinatra.application | |
end | |
# Rest with Rails | |
map "/" do | |
run ActionController::Dispatcher.new | |
end | |
}.to_app | |
Rack::Handler::Thin.run app, :Port => 3000, :Host => "0.0.0.0" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment