I'm working on a small server (NodeJS environment) to get JSON data from a URL and a local file to compare these.
I'm using 'get-json' to load the JSON form the url and get some values, unfortunately it doesn't work for the local file.
I tried it with 'request' too.
var getJSON = require('get-json')
var localpath = "./location/file.json"
getJSON(localpath, function(data, allowed_content) {
var a = allowed_content[0].age;
var b = allowed_content[1].age;
var c = allowed_content[2].age;
var d = allowed_content[5].age;
var e = allowed_content[6].age;
});
I can't figure it out why the local path isn't working.