text: const router = require('express').Router();
  const { Comment } = require('../../models/');
  const withAuth = require('../../utils/auth');
  
  //This is the comments route that can only be access using the right logins.
  // If 'withauth' does not fight matching credentials it wont allow the access
  router.post('/', withAuth, async (req, res) => {
    try {
      const newComment = await Comment.create({
        ...req.body,
        userId: req.session.userId,
      });
      res.json(newComment);
    } catch (err) {
      res.status(500).json(err);
    }
  });
  
  module.exports = router;
  