Skip to content

Instantly share code, notes, and snippets.

@cookrn
Created June 10, 2011 20:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cookrn/1019717 to your computer and use it in GitHub Desktop.
Save cookrn/1019717 to your computer and use it in GitHub Desktop.
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