express.basicAuth as a DocPad plugin.

npm install docpad-plugin-basicauth
4 downloads in the last week
9 downloads in the last month
Express' basicAuth() as a DocPad plugin.

Much thanks to Andrew Sengul for the great help & guidance in the #docpad IRC as usual.


Add the protected route and user/pass info to the configuration file like so:

docpadConfig = {

    # =================================
    # Plugin Configuration

    # Skip Unsupported Plugins
    # Set to `false` to load all plugins whether or not they are compatible with our DocPad version or not
    skipUnsupportedPlugins: false,

     # Enabled Plugins
    enabledPlugins:  # example
        # Disable the Pokemon Plugin
        # pokemon: false
        persona: false
        fileupload: false
        uploadfile: false

    # Upload Directory
    # uploadDir: './uploads'

    # Express' basicAuth
        protectedPage: '/fileupload'
        user: 'testUser'
        pass: 'testPass'

And that's it for now!

npm loves you