Just enough authentication to make an API private
Switch branches/tags
Clone or download
elnaz Merge pull request #5 from elnaz/fix-badge
fix(badges): fix coveralls image
Latest commit 8982257 Aug 2, 2016

README.md

hapi-tiny-auth

Build Status Coverage Status

Just enough authentication to make an API private. This Hapi plugin will allow only one set of configured credentials to access any of the API's endpoints. Must be used with hapi-auth-basic.

Install

$ npm i hapi-tiny-auth --save

Register

const Hapi = require('hapi');

const server = new Hapi.Server();

server.register([
  require('hapi-auth-basic'),
  {
    register: require('hapi-tiny-auth'),
    options: {
      username: 'USERNAME', // required
      password: 'PASSWORD'  // optional
    }
  }
], (err) => {

});