Skip to content

Instantly share code, notes, and snippets.

@bmizerany
Created November 12, 2008 19:22
Show Gist options
  • Save bmizerany/24241 to your computer and use it in GitHub Desktop.
Save bmizerany/24241 to your computer and use it in GitHub Desktop.
# 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