I am attempting to lea node and JavaScript. I have implemented the use of a node module that retrieves train jouey times.
I can retrieve and display the times within the command line but i caot display in the RESTFUL client.
//GET ALL TRAIN TIMES
router.route('/train_times')
//get all the times (accessed at GET http://localhost:8000/api/times)
.get(function(req, res) {
cw.times(function(err, res, json){
var times = json.films;
for (index = 0; index < time.length; ++index) {
console.log(time[index].data);
}
//It is here i try and display the train times
res.json(times);
});
});
