NodeJs Connect-restで REST API を作成しましたが、最後の呼び出しが行われた日時を保存する方法を知りたいと思っていました。
ここにGET URL呼び出しがあります
http://localhost:8080/api/books/metadata?id=12
この ID をフィルタリングするコードの抜粋
module.exports.getItem = function(callback, id) {
var searchLetter = new RegExp(id, 'i');
//would like to record date/time the last time this call was made to this ID/row
//return the date/time back in the callback method
var row = items.filter(function(itemList) {
return searchLetter.test(itemList.asname);
});
return callback(null, {items: row, matches: row.length}, {headers: {'Content-type': 'application/json'}});
};