Http-auth middleware for grunt-connect.
This plugin requires Grunt
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-connect-http-auth --save-dev
The "grunt-connect-http-auth" task
In your project's Gruntfile, add a section named
auth to the
connect data object passed into
grunt.initConfig(). You find the configurations in the http-auth project.
Adding the middleware
Expose the http-auth function to use in the middleware, at the top of the grunt file:
var authRequest = authRequest;
Add the middleware call from the connect option middleware hook
Adding the "configureHttpAuth" task to the server task
For the server task, add the "configureHttpAuth" task before the "connect" task
- Better tests