Simpleusermanager is a nodejs module for manage user with a mysql database
simply install simpleusermanager with npm like this
npm install --save simpleusermanager
Once installed you can use it by calling require(simpleusermanager)
This project require mysql
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);
});
});