Skip to content

Instantly share code, notes, and snippets.

@cookrn

cookrn/config.ru

Created Jun 10, 2011
Embed
What would you like to do?
Rack 1.3.0 & Serving Static Files
# Set Our Root Path
::ROOT = File.dirname( File.expand_path( __FILE__ ) )
# Boot The App
require "#{ROOT}/config/boot.rb"
# Serve our index file by default
use Rack::Static , :urls => { "/" => "index.html" } , :root => "public"
# Setup Rack
run Rack::URLMap.new( {
"/" => Rack::Directory.new( "public" ), # Serve our static content
"/app" => App.new # Sinatra app
} )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment