I need to change my database from a mongo to a PostgreSQL server. Anything would help thanks. SERVER CODE: console.log(‘Server-side code running’); const express = require(‘express’); const MongoClient = require(‘mongodb’).MongoClient; const app = express(); app.use(express.static(‘public’)); let db; const url = ‘mongodb://localhost:27017/clicks’; MongoClient.connect(url, (err, database) => { if (err) { return console.log(err); } db = database; // start the express web server listening on 8080 app.listen(8080, () => { console.log(‘listening on 8080’); }); }); app.get(‘/’, (req, res) => { res.sendFile(__dirname + ‘/index.html’); }); app.post(‘/clicked’, (req, res) => { db.collection(‘clicks’).findOneAndUpdate({}, {$inc: {click : 1}}, (err, result) => { if(err) throw err; res.send(result); }); }); //console.log(click); //console.log(db); // db.collection(‘clicks’).save(click, (err, result) => { // if (err) { // return console.log(err); // } // console.log(‘click added to db’); // res.sendStatus(201); // }); // }); app.get(‘/clicks’, (req, res) => { db.collection(‘clicks’).findOne({ “myId” : “skylar” },function(err, result){ if (err) return console.log(err); res.end(result.click+”); }); }); CLIENT CODE: console.log(‘Client-side code running’); const button = document.getElementById(‘myButton’); button.addEventListener(‘click’, function(e) { console.log(‘button was clicked’); fetch(‘/clicked’, {method: ‘POST’}) .then(function(response) { if(response.ok) { console.log(‘click was recorded’); return; } throw new Error(‘Request failed.’); }) .catch(function(error) { console.log(error); }); }); setInterval(function() { fetch(‘/clicks’, {method: ‘GET’}) .then(function(response) { if(response.ok) return response.json(); throw new Error(‘Request failed.’); }) .then(function(data) { document.getElementById(‘counter’).innerHTML = `Button was clicked ${data} times`; }) .catch(function(error) { console.log(error); }); }, 1000); HTML CODE: <!DOCTYPE html> Node + Express + MongoDb h1 { text-align: center; } p { text-align: center; } .button-center { text-align: center; padding-top: 50px; } #myButton { height: 50px; width: 150px; border: 2px solid black; } Loading button click data. The Button