ruby 如果你想在heroku上为你的中间人应用程序添加基本身份验证,这是一个添加到middleman的config.ru文件的片段

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ruby 如果你想在heroku上为你的中间人应用程序添加基本身份验证,这是一个添加到middleman的config.ru文件的片段相关的知识,希望对你有一定的参考价值。

# 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']

以上是关于ruby 如果你想在heroku上为你的中间人应用程序添加基本身份验证,这是一个添加到middleman的config.ru文件的片段的主要内容,如果未能解决你的问题,请参考以下文章