8
私はHerokuでホストされている簡単なRackアプリケーションを持っています。 config.ru:HTTPの基本認証:Herokuの静的アプリケーション
use Rack::Static,
:urls => ["/stylesheets", "/images", "/javascripts"],
:root => "public"
run lambda { |env|
[
200,
{
'Content-Type' => 'text/html',
'Cache-Control' => 'public, max-age=86400'
},
File.open('public/index.html', File::RDONLY)
]
}
これにHTTP基本認証を追加するにはどうすればよいですか?プロダクション環境でのみ動作するボーナスポイント。
あなたはまた、基本的な認証の後ろに画像、スタイルシートとJavaScriptを保護したい場合はおかげ