Skip to content

haxzie-xx/humkin-server

Repository files navigation

HumKin Server

Node/Express.js server for HumKin, Open BloodBank Management System

Make sure Node.js and npm are updated

clone the repo and run

npm install

for development, install supervisor on your system

npm install --global supervisor

run the development server

supervisor index.js

Or run the app

node index.js

Implementation

Update the dbconfig.json

{
    "host": "localhost",
    "user": "root",
    "password": "root",
    "database": "humkin"
}

Connecting to the MySql Database /db.js

var mysql = require('mysql');
var config = require('./dbconfig.json');
var connection;

module.exports = () => {
    if (!connection) {
        connection = mysql.createConnection(config);
        connection.connect(function(err){
            if(!err) {
                console.log('Database is connected!');
            } else {
                console.log('Error connecting database!');
            }
        });
    }
    return connection;
}

Releases

No releases published

Packages

No packages published