account-logger

Add logging to the account interface

Account Couch Logger

Implement the account interface using a couchdb backend with the couch-profile module plus logging via a winston logger

Installation

npm install -S account-couch-logger

Usage

The account couch module exports register and login functions

To register a new account, pass an email, password and a cradle db connection

 
var config = require('nconf').defaults({
  couch: {
    host: 'localhost',
    port: 5984,
    database: 'account_couch_test'
  }    
})
var logger = require('loggly-console-logger')
var account = require('account-couch')(logger)
var db = require('cradle-nconf')(config)
var data = {
  email: 'foo@example.com',
  password: 'barPassword',
  db: db
}
accountCouch.register(data, function (errreply) {
  if (err) {
    inspect(err, 'error registering user account')
    return
  }
  inspect(reply, 'account created correctly'
})

Test

To run the test suite execute

# install development deps
npm install
# run tests
npm test