Full disclosure i have done some Google searching on this but i’m aware i may not be asking the correct questions to find what i’m looking for.
I’m using a react template found on Github for an internal application for work that i intend to utilize for searching a json file.
link for reference – Link
the source file in the example is like this:
const initialDetails = [
{
id: 1,
imgPath: "/assets/img/1.png",
name: "Jane Doe",
email: "[email protected]",
address: "New Delhi, India",
},
{
id: 2,
imgPath: "/assets/img/2.png",
name: "Mary Rosamund",
email: "[email protected]",
address: "Tbilisi, India",
},
{
id: 3,
imgPath: "/assets/img/3.png",
name: "Sherlock Watson",
email: "[email protected]",
address: "Baker Street, India",
},
{
id: 4,
imgPath: "/assets/img/4.png",
name: "John Holmes",
email: "[email protected]",
address: "Baker Street, India",
},
{
id: 5,
imgPath: "/assets/img/5.png",
name: "Mycroft Lestrade",
email: "[email protected]",
address: "London, India",
},
];
export default initialDetails;
What i would like to is for the equivalent of const initialDetails = “jsonFilePath”
The file i need to query is updated once a minute.
What is the standard way to perform this type of function?
As i’ve stated, i may not be asking the correct questions needed to obtain this solution through Google so thats what led me here.