Skip to content

Commit

Permalink
use latest Rack and serve everything as a static asset
Browse files Browse the repository at this point in the history
catch all unrecognised routes with a 404
  • Loading branch information
stevenwilkin committed Jan 30, 2012
1 parent 7bd6a5d commit 803a95e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Original file line Diff line number Diff line change
@@ -1,7 +1,7 @@
GEM GEM
remote: http://rubygems.org/ remote: http://rubygems.org/
specs: specs:
rack (1.3.5) rack (1.4.1)


PLATFORMS PLATFORMS
ruby ruby
Expand Down
13 changes: 2 additions & 11 deletions config.ru
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2,15 +2,6 @@ require './lib/no_www'


use NoWWW use NoWWW


use Rack::Static, :urls => ['/css', '/img'], :root => 'public' use Rack::Static, :urls => [''], :root => 'public', :index => 'index.html'


run lambda { |env| run lambda { |env| [404, {'Content-Type' => 'text/plain'}, 'Not found'] }
[
200,
{
'Content-Type' => 'text/html',
'Cache-Control' => 'public, max-age=86400'
},
File.open('public/index.html', File::RDONLY)
]
}

0 comments on commit 803a95e

Please sign in to comment.