simpleusermanager
v1.3.2
Published
Node module for manage user
Downloads
4
Maintainers
Readme
SimpleUserManager
Simpleusermanager is a nodejs module for manage user with a mysql database
Geting started
simply install simpleusermanager with npm like this
npm install --save simpleusermanager
Once installed you can use it by calling require(simpleusermanager)
Dependencies
This project require mysql
Example
Simple login system using express, mysql and simpleusermanager
var manager = require(simpleusermanager)
const express = require('express');
var mysql = require('mysql');
var con = mysql.createConnection({
// Setup your mysql object
});
const app = express();
app.post('/login',function(req,res){
var username = req.body.username, password = req.body.password
usermanager.login(con, username, password, function(err, data) {
if (err) throw err;
console.log(data.id);
});
});