Permalink
Browse files

Merge pull request #91 from devinus/master

Server index.html as root
  • Loading branch information...
2 parents d66f1cc + 88dd3f1 commit 67bc55f69bae1196d39430b1ae664bef4e506530 @wagenet wagenet committed Dec 6, 2011
Showing with 5 additions and 0 deletions.
  1. +1 −0 bpm.gemspec
  2. +4 −0 lib/bpm/server.rb
View
@@ -25,6 +25,7 @@ Gem::Specification.new do |s|
s.add_dependency "sprockets", "~> 2.0.0"
s.add_dependency "eventmachine", "~> 1.0.0.beta.4" # There are issues with 0.12.10 and thin
s.add_dependency "thin", "~> 1.2"
+ s.add_dependency "rack-rewrite", "~> 1.2.1"
s.add_development_dependency "rspec"
s.add_development_dependency "rack", "~> 1.3.2"
View
@@ -1,4 +1,5 @@
require 'rack'
+require 'rack-rewrite'
require 'sprockets'
require 'thin'
@@ -33,6 +34,9 @@ def app
@app ||= ::Rack::Builder.new do
use BPM::Rack, cur_project, :mode => cur_mode
+ use ::Rack::Rewrite do
+ rewrite /^(.*)\/$/, '$1/index.html'
+ end
run ::Rack::Directory.new cur_project.root_path
end.to_app
end

0 comments on commit 67bc55f

Please sign in to comment.