spee.ch/routes/analytics-routes.js
2017-06-27 20:25:36 -07:00

17 lines
513 B
JavaScript

const errorHandlers = require('../helpers/libraries/errorHandlers.js');
const analyticsController = require('../controllers/analyticsController.js');
module.exports = (app) => {
// route to show analytics
app.get('/analytics', (req, res) => {
// get and serve content
analyticsController
.getAnalyticsSummary()
.then(result => {
res.status(200).render('analytics', result);
})
.catch(error => {
errorHandlers.handleRequestError(error, res);
});
});
};