Can I protect with a .htaccess file some routes with sinatra?
I开发者_如何学Python wrote a small app with Sinatra and have some admin routes (/admin/new, admin/edit/2, ...) and want to protect them with a .htaccess prompt. Can somebody tell me how I do that?
AuthName "Restricted Area"
AuthType Basic
AuthUserFile /path/to/file/.htpasswd
<Files "protected.html">
Require valid-user
</Files>
If you want to use Sinatra for Authentication, check out this faq.
精彩评论