Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/nisaacson/userific-mongoose

Mongoose & MongoDB based backend to the userific interface
https://github.com/nisaacson/userific-mongoose

Last synced: about 1 month ago
JSON representation

Mongoose & MongoDB based backend to the userific interface

Awesome Lists containing this project

README

        

# Userfic Mongoose backend

Manage users using mongoose and MongoDB. This module implements the abstract [Userific](https://github.com/nisaacson/userific) interface

# Installation

```bash
npm install -S userific-mongoose
```

# Usage

```javascript
var UserificMongoose = require('userific-mongoose')
var config = {
host: 'localhost', // the host of the MongoDB server
port: '27017', // the port of the MongoDB server
db: 'userific-mongoose-test' // the mongodb database to use
user: 'mongodb username here', // optional
pass: 'mongodb username here', // optional
}

var backend = new UserificMongoose(config)
// backend implements all the interface methods of the abstract Userific module
var registerData = {
email: '[email protected]',
password: 'barPassword'
}
backend.register(registerData, function(err, user) {
if (err) {
inspect(err, 'error registering user via the userific mongoose backend')
return
}
inspect(user, 'registered user correctly')
})
```

# Test

```bash
# install development dependencies
npm install
# run tests
npm test
```