Skip to content

Instantly share code, notes, and snippets.

@michaelparenteau
Last active January 29, 2016 05:55
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save michaelparenteau/6244378 to your computer and use it in GitHub Desktop.
Save michaelparenteau/6244378 to your computer and use it in GitHub Desktop.
Basic Auth Middleman & Heroku
# This is a snippet to add to middleman's config.ru file if you want to add basic auth to your middleman app on heroku
# NOTE: you need to stick this above the build script like shown below
use Rack::Auth::Basic, "Restricted Area" do |username, password|
[username, password] == ['username', 'password']
end
# This part below is just what builds the static site. you only need to add lines 4 - 6 above any build command like shown below.
use Rack::TryStatic, :root => "build", :urls => %w[/], :try => ['.html', 'index.html', '/index.html']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment