{"size": 422, "ext": "js", "max_stars_repo_path": "routes/api.js", "max_stars_repo_name": "smanter82/manter_react_portfolio", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "routes/api.js", "max_issues_repo_name": "smanter82/manter_react_portfolio", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "routes/api.js", "max_forks_repo_name": "smanter82/manter_react_portfolio", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 24.8235294118, "max_line_length": 47, "alphanum_fraction": 0.6374407583}
const router = require("express").Router();
const db = require("../models/");

router.route("/message").post((req, res) => {
  const newMessages = new db.Messages({
    contact_name: req.body.contact_name,
    email: req.body.email,
    message: req.body.message,
  });
  newMessages
    .save()
    .then((dbMessages) => res.send(dbMessages))
    .catch((err) => res.status(500).json(err));
});

module.exports = router;
