mirror of
https://github.com/danog/sass-site.git
synced 2024-11-30 04:29:17 +01:00
Clean up config.ru
"middleman serve", not "rackup", should be used for local development.
This commit is contained in:
parent
d41c63c10d
commit
a054b4848f
20
config.ru
20
config.ru
@ -22,22 +22,12 @@ use Rack::Rewrite do
|
||||
|
||||
r301 %r{/(.+)/$}, '/$1'
|
||||
r301 %r{/(.+)/index\.html$}, '/$1'
|
||||
end
|
||||
rack
|
||||
|
||||
use Rack::Deflater
|
||||
|
||||
if ENV["HEROKU"].nil? || ENV["HEROKU"] == 'false'
|
||||
require "middleman"
|
||||
use Rack::TryStatic,
|
||||
urls: ["/"], root: 'build', index: 'index.html',
|
||||
try: ['.html', '/index.html']
|
||||
|
||||
server = Middleman.server
|
||||
run Rack::Cascade.new([
|
||||
server,
|
||||
lambda {|env| server.call(env.merge!('PATH_INFO' => '/404'))}
|
||||
])
|
||||
else
|
||||
use Rack::TryStatic,
|
||||
:urls => ["/"], :root => 'build', :index => 'index.html',
|
||||
:try => ['.html', '/index.html']
|
||||
|
||||
run Rack::NotFound.new("build/404.html")
|
||||
end
|
||||
run Rack::NotFound.new("build/404.html")
|
||||
|
Loading…
Reference in New Issue
Block a user