Hi there, I am looking to retrieve data from my JSON file and then display it in HTML. Before that, I want to simply log it in the console. How can I accomplish this task? The JSON file will be updated based on user input.
varer.json
[{"id":"aa","varer":"aa","pris":""},{"id":"aa","varer":"aa","pris":""}]
varer-controller
const varerModel = require("./../models/varer");
const express = require("express");
const router = express.Router();
router.get("/getproducts", (req, res) =>{
var products = JSON.parse(varerModel)
console.log(products)
res.send(products)
})