Last active
January 29, 2016 05:55
-
-
Save michaelparenteau/6244378 to your computer and use it in GitHub Desktop.
Basic Auth Middleman & Heroku
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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