The images module

The images module is responsible for returning various collections of images. Initially, we will create a popular function that will be used to return a collection of the most popular images on the website. Initially, this collection will simply be an array of image objects with the sample fixture data present.

Create the helpers/images.js file, and insert the following code:

module.exports = {
popular() {
let images = [{
uniqueId: 1,
title: 'Sample Image 1',
description: '',
filename: 'sample1.jpg',
Views: 0,
likes: 0,
timestamp: Date.now()
},
{
uniqueId: 2,
title: 'Sample Image 2',
description: '',
filename: 'sample2.jpg',
Views: 0,
likes: 0,
timestamp: Date.now()
},
{
uniqueId: 3,
title: 'Sample Image 3',
description: '',
filename: 'sample3.jpg',
Views: 0,
likes: 0,
timestamp: Date.now()
},
{
uniqueId: 4,
title: 'Sample Image 4',
description: '',
filename: 'sample4.jpg',
Views: 0,
likes: 0,
timestamp: Date.now()
}
];
return images;
}
};
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.146.221.144