Skip to content

Instantly share code, notes, and snippets.

@adamesque
Created June 1, 2011 19:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save adamesque/1003046 to your computer and use it in GitHub Desktop.
Save adamesque/1003046 to your computer and use it in GitHub Desktop.
Password-protected Middleman via Rack/Heroku
require 'rubygems'
require 'middleman'
middleman_app = Middleman::Server.new
protected_middleman = Rack::Auth::Basic.new(middleman_app) do |username, password|
[username, password] == ['theuser', 'thepassword']
end
run protected_middleman
@webfella
Copy link

webfella commented Nov 8, 2012

Using the above in my rack config gives me the following error log

uninitialized constant Middleman::Server (NameError)

@polarblau
Copy link

@webfella — I believe it should nowadays probably be more something like this: https://gist.github.com/polarblau/5817541

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