The stats module

The stats module will display a few random pieces of statistics about our app. Specifically, it will show the count for the total number of images, comments, Views, and likes for the entire website.

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

module.exports = () => {
const stats = {
images: 0,
comments: 0,
Views: 0,
likes: 0
};
return stats;
};

This module is pretty basic, and all it does is create a standard JavaScript object with a few properties for the various stats, each set initially to 0.

..................Content has been hidden....................

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