#authenticationService
A node.js module for NodeJS Avanscoperta Course. authenticationService offers authentication API
npm install @piemme/authentication-service
var auth = require('@piemme/authentication-service')([connectionString]);
auth.put({
username: "exetera",
password: "pippo"
}, function (err, result) {
console.log(result)
});
A method to insert an user in a Mongo database.
var user = {
username: "exetera12323",
password: "pippo"
}
auth.put(user, function callback (err, result){
console.log(result)
});
A method to get an existing user from a Mongo database.
var user = {
username: "exetera2",
password: "pippo"
};
auth.get(user, function(err, result){
console.log(result)
});
A method to close the connection to Mongo database.
function(){
db.close();
}
Joi for validation
mongojs for database connection
tape for testing