Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #91 from devinus/master

Server index.html as root
  • Loading branch information...
commit 67bc55f69bae1196d39430b1ae664bef4e506530 2 parents d66f1cc + 88dd3f1
@wagenet wagenet authored
Showing with 5 additions and 0 deletions.
  1. +1 −0  bpm.gemspec
  2. +4 −0 lib/bpm/server.rb
View
1  bpm.gemspec
@@ -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
4 lib/bpm/server.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.