var express = require('express');
var router = express.Router();

var books = [
  { title: 'Who Moved My Cheese', author: 'Spencer Johnson', price: 12.03, date: new Date('09/08/1998'), link: 'https://www.amazon.com/Who-Moved-My-Cheese-Amazing/dp/0399144463'},
  { title: 'The 7 Habits of Highly Effective People', author: 'Stephen Covey', price: 10.60, date: new Date('11/09/2004'), link: 'https://www.amazon.com/Habits-Highly-Effective-People-Powerful/dp/0743269519'},
  { title: 'The Checklist Manifesto', author: 'Atul Gawande', price: 9.99, date: new Date('04/01/2010'), link: 'https://www.amazon.com/Checklist-Manifesto-How-Things-Right-ebook/dp/B0030V0PEW'}
];   

router.get('/', function(req, res, next) {
  res.send(books);
});

module.exports = router;
