I have a function in javascript which I hard-coded as of now:
function getCarData()
{
return
[
{car: "Nissan", year: 2009, chassis: "black", bumper: "black"},
{car: "Nissan", year: 2006, chassis: "blue", bumper: "blue"},
{car: "Chrysler", year: 2004, chassis: "yellow", bumper: "black"},
{car: "Volvo", year: 2012, chassis: "white", bumper: "gray"}
];
}
Now.. this was just to unit test whether the code will work or not.. But now it is working..
I am generating this data on backend and am mapping it to the directory on server (which is localhost at the moment)
So if I go to localhost:5000/cardata I have exact same data i.e
[
{car: "Nissan", year: 2009, chassis: "black", bumper: "black"},
{car: "Nissan", year: 2006, chassis: "blue", bumper: "blue"},
{car: "Chrysler", year: 2004, chassis: "yellow", bumper: "black"},
{car: "Volvo", year: 2012, chassis: "white", bumper: "gray"}
];
What changes I should made on my javascript file in order to make this work?