under the profile route, you'll want to ensure that queries are run under each promise's callback. You can't guarantee that the last query returns after the first two. Ways around this:
combine the first and second queries, so each link has a sum of unique clicks
eliminate the last query, since req.user is already loaded by Passport, and you're not using the user
In controllers/stats.js
rename ul and dl to be more semantic
In controllers/root.js
rename :id on line 30 to :hash, in order to correctly describe what's being passed in
use a .then promise on line 36
Front-end notes
page-global.js
encapsulate the global variables associated with stats in an object. Optionally, put inside a IIFE, or use this syntax for creating the object:
Back-end notes
req.user
is already loaded by Passport, and you're not using the usercontrollers/stats.js
ul
anddl
to be more semanticcontrollers/root.js
:id
on line 30 to:hash
, in order to correctly describe what's being passed in.then
promise on line 36Front-end notes