mkoopajr / hapi-session-mongo Goto Github PK
View Code? Open in Web Editor NEWMongoDB session storage for hapi
License: Other
MongoDB session storage for hapi
License: Other
cant install this module, instead i use https://www.npmjs.com/package/bcrypt-node
When you are testing you will want to set this up on TravisCI.
You will need to create a shell script that will install MongoDB and prep it with dummy users. The setup the ENV variables and start the tests.
Bunch of docs here: http://docs.travis-ci.com/user/languages/javascript-with-nodejs/
Once that's hooked up (you have to make this repo public before that) you need to also add a section to the readme about testing, etc..
This is errback
style
foo(function(err, data) {
if (err) {
return callback(err);
}
//Proceed with happy path logic
});
Instead of callback(false)
use callback(null)
. null
means it's ok
Instead of callback(true)
use callback(err)
. err
allows the user to respond to the actual error
If you are generating an error, as in invalid config or something use:
callback(new Error('you did something wrong'))
Code:
This code could be written simpler
module.exports = function(options) {
options = options || {}; // ensures that options is not undefined
var ip = options.ip || '127.0.0.1', // very simple || works here
port = options.port || 27017,
dbName = options.db || 'test',
dbUser = options.name, // no need for undefined, it's undefined if it's undefined :)
dbPwd = options.pwd
ssl = options.ssl, // false not required here, undefined is falsey and should work
ttl = options.ttl || 0;
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.