Clean up config.ru

"middleman serve", not "rackup", should be used for local development.
This commit is contained in:
Natalie Weizenbaum 2018-12-28 16:38:26 -08:00
parent d41c63c10d
commit a054b4848f

View File

@ -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")