title: How to protect rspec_api_documentation apitome route without a controller
body: <p>I have a set of API documentation pages that I want to password protect using devise. The docs are generated using rspec_api_documentation. The gem uses rspec to execute the API methods and create html or json doc files. I'm generating json and using another gem, apitome, as a viewer.</p>
  
  <p>This is all working beautifully and my api docs can be found at /api/docs, but I can't figure out how to require authentication to view the docs.</p>
  
  <p>The docs are viewed through apitome so it using rails. There isn't a route in routes.rb, but the apitom initializer mounts the docs.</p>
  
  <p>From apitom initializer:</p>
  
  <pre><code># This determines where the Apitome routes will be mounted. Changing this to "/api/documentation" for instance would
  # allow you to browse to http://localhost:3000/api/documentation to see your api documentation. Set to nil and mount
  # it yourself if you need to.
  config.mount_at = "/api/docs"
  </code></pre>
  
  <p><a href="https://github.com/zipmark/rspec_api_documentation" rel="nofollow">https://github.com/zipmark/rspec_api_documentation</a></p>
  
  <p><a href="https://github.com/modeset/apitome" rel="nofollow">https://github.com/modeset/apitome</a></p>
  
  <p>I found this How-to that is supposed to make every page on the site require authenication, but I'm still able to hit the docs url without signing in.</p>
  
  <pre><code>#https://github.com/plataformatec/devise/wiki/How-To:-Require-authentication-for-all-pages
  </code></pre>
  
  <p>Thanks for any help.</p>