Skip to content

jstty/hyper.io-express-auth-basic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hyper.io-express-basicauth

Express Basic Auth Middleware for Hyper.io

NPM

$ npm install hyper.io-express-auth-basic

Use

var hyper     = require('hyper.io');
var basicAuth = require('hyper.io-express-auth-basic');

// add Basic Auth, this is optional,
// hyper.io will auto try to require the 'auth-basic'
// if it's not included in the middleware already
hyper().use(basicAuth);

// load config and routes
hyper().start({
    routes: [
        {
            required: {
                'auth-basic': {
                    user: 'joe',
                    pass: 'bob',
                    message: 'Login with user:"joe" pass:"bob"'
                }
            },
            api: "/hello",
            method: {
                get: function world($done)
                {
                    $done( { hello: "world" } );
                }
            }
        }
    ]
});

About

Express Basic Auth Middleware for Hyper.io

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published