Javascript – unable to retrieve data using postgres and nodeJS
Here is how i've set the following files: index.js const express = require('express') const app = express() const port = 8000 const expense_model = require('./expense_model') app.use(express.json()); app.use(function (req, res, next) { res.setHeader('Access-Control-Allow-Origin', 'http://localhost:8000'); res.setHeader('Access-Control-Allow-Methods', 'GET,POST,PUT,DELETE,OPTIONS'); res.setHeader('Access-Control-Allow-Headers', 'Content-Type, Access-Control-Allow-Headers'); next(); });…