Skip to content

Instantly share code, notes, and snippets.

@polarblau
Forked from adamesque/config.ru
Created June 19, 2013 20:01
Show Gist options
  • Star 13 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save polarblau/5817541 to your computer and use it in GitHub Desktop.
Save polarblau/5817541 to your computer and use it in GitHub Desktop.
Protect a Middleman application via basic auth
require 'rubygems'
require 'middleman/rack'
protected_middleman = Rack::Auth::Basic.new(Middleman.server) do |username, password|
[username, password] == ['theuser', 'thepassword']
end
run protected_middleman
@antsa
Copy link

antsa commented Nov 14, 2013

Thank you for this @polarblau :)

@samselikoff
Copy link

Thank you. thank you thank you thank you.

Wish I had found this 2 hours ago !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment