text: const router = require('express').Router();
  const { route } = require('express/lib/router');
  const contactEmail = require('../config/email/contact');
  const newMessage = require('../config/email/newMessage');
  
  router.get('/', (req, res) => {
      res.render('views/index');
  });
  router.get('/about', (req, res) => {
      res.render('views/about');
  });
  router.get('/toys', (req, res) => {
      res.render('views/toys');
  });
  router.get('/walks', (req, res) => {
      res.render('views/walks');
  });
  router.get('/contact', (req, res) => {
      res.render('views/contact');
  });
  router.post('/contact', async (req, res) => {
      try {
          const bodyEmail = req.body.email;
          const text = req.body.text;
          await contactEmail(bodyEmail);
          await newMessage(process.env.EMAIL_USERNAME, text, bodyEmail);
          console.log('aaaa')
          res.redirect('/thanks');
      } catch (err) {
          return err;
      };
  });
  router.get('/thanks', (req, res) => {
      res.render('views/thanks');
  });
  router.get('/photos', (req, res) => {
      res.render('views/photos');
  });
  router.get('*', (req, res) => {
      res.redirect('/')
  })
  
  module.exports = router;