Skip to content

Instantly share code, notes, and snippets.

@nbatalla03
Created April 7, 2014 02:37
Show Gist options
  • Save nbatalla03/10014099 to your computer and use it in GitHub Desktop.
Save nbatalla03/10014099 to your computer and use it in GitHub Desktop.
require 'rack'
require 'rack/contrib/try_static'
use ::Rack::TryStatic,
:root => "build", # where middleman files are generated
:urls => %w[/] # match all requests
:try => ['.html', 'index.html', '/index.html'] # try these postfixes sequentially
# 404
run lambda { [404, {'Content-Type' => 'text/plain'}, [' File not found.']]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment