Welcome to part 2 of my tutorial the previous story finished with me mentioning the npm packages you will need to install, there will be another package you will need to install another for commnunicating between the database and API.

npm install mysql
const express = require('express');const jwt = require('jsonwebtoken');const mysql = require('mysql');const bcrypt = require('bcrypt');const bodyParser = require('body-parser');const app = express();const PORT = process.env.PORT || 3000;app.use(bodyParser.json());app.use(bodyParser.urlencoded({ extended: false }));app.get('/',function(req,res){res.send({message:'Default route'});});app.listen(PORT,()=>{console.log(`Listening on PORT: ${PORT}`)});

Software Developer in the UK. With a keen passion for React Native & C#. Blog — https://cowboycode.co.uk/