{"size": 444, "ext": "js", "max_stars_repo_path": "public/sendMail.js", "max_stars_repo_name": "donaldboulton/DWB", "max_stars_repo_stars_event_min_datetime": "2018-02-24T22:53:39.000Z", "max_stars_repo_stars_event_max_datetime": "2022-02-21T22:24:55.000Z", "max_issues_repo_path": "public/sendMail.js", "max_issues_repo_name": "donaldboulton/DWB", "max_issues_repo_issues_event_min_datetime": "2018-08-31T13:54:43.000Z", "max_issues_repo_issues_event_max_datetime": "2021-02-08T03:54:23.000Z", "max_forks_repo_path": "public/sendMail.js", "max_forks_repo_name": "donaldboulton/DWB", "max_forks_repo_forks_event_min_datetime": "2019-06-16T06:44:05.000Z", "max_forks_repo_forks_event_max_datetime": "2021-02-14T06:45:02.000Z"}
{"max_stars_count": 19, "max_issues_count": 54, "max_forks_count": 4, "avg_line_length": 27.75, "max_line_length": 54, "alphanum_fraction": 0.6238738739}
const express = require('express');
const sendMail = express.Router();
const emailUtil = require('./email-util');
const { sendEmail } = emailUtil;
sendMail.post('/mail', async (req, res, next) => {
  const { recipient, message } = req.body;
  try {
      await sendEmail(recipient, message);
      res.json({message: 'Your query has been sent'});
      await next();
     } catch (e) {
      await next(e);
   }
 });
module.exports = sendMail;
