Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/nisaacson/userific-mongoose
- Owner: nisaacson
- Created: 2013-06-06T22:55:15.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-06-21T22:07:57.000Z (over 11 years ago)
- Last Synced: 2024-09-13T05:54:37.570Z (2 months ago)
- Language: JavaScript
- Size: 175 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
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
```