/** @module root/router */
'use strict';
// vim: set ts=2 sw=2 et tw=80:

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

const mongoose = require('mongoose');
const Favorite = mongoose.model('Favorite');
const fetch = require('node-fetch');
const querystring = require('querystring');
const promiseAny = require('promise-any');
const eventBus = require('../../pubsub');
const fetch64 = require('fetch-base64');

const { error } = require('../utils');

router.get('/', (req, res) => {
  Favorite.find({}, (err, favs) => {
    if (err) {
      return error(err, res);
    }
    res.render('index.dust', { favs });
  });
});

/** router for /root */
module.exports = router;
