Skip to content

Instantly share code, notes, and snippets.

@Joseworks
Forked from pmkhoa/config.ru
Created April 14, 2017 15:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Joseworks/fba283624b69d62ef002b0742eeebdfa to your computer and use it in GitHub Desktop.
Save Joseworks/fba283624b69d62ef002b0742eeebdfa to your computer and use it in GitHub Desktop.
Middleman Authentication via Rack
require 'rubygems'
require 'middleman/rack'
protected_middleman = Rack::Auth::Basic.new(Middleman.server) do |username, password|
[username, password] == ['theuser', 'thepassword']
end
run protected_middleman
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment