{"size": 460, "ext": "js", "max_stars_repo_path": "routes/articles-api-routes.js", "max_stars_repo_name": "jasonstevens13/giph-you-times", "max_stars_repo_stars_event_min_datetime": "2020-06-19T23:45:39.000Z", "max_stars_repo_stars_event_max_datetime": "2020-06-20T01:06:32.000Z", "max_issues_repo_path": "routes/articles-api-routes.js", "max_issues_repo_name": "jasonstevens13/giph-you-times", "max_issues_repo_issues_event_min_datetime": "2021-05-11T15:49:43.000Z", "max_issues_repo_issues_event_max_datetime": "2021-05-11T15:49:43.000Z", "max_forks_repo_path": "routes/articles-api-routes.js", "max_forks_repo_name": "jasonstevens13/giph-you-times", "max_forks_repo_forks_event_min_datetime": "2020-06-18T17:38:47.000Z", "max_forks_repo_forks_event_max_datetime": "2020-06-19T23:45:41.000Z"}
{"max_stars_count": 2, "max_issues_count": 1, "max_forks_count": 2, "avg_line_length": 17.037037037, "max_line_length": 61, "alphanum_fraction": 0.5652173913}
var db = require("../models");

module.exports = function (app) {


  app.get("/giphs", function (req, res) {

    db.Articles.findAll({
    }).then(function (dbArticles) {

      let hbsObject = {
        articles: dbArticles
      };

      res.render("giphs", hbsObject);
    });
  });


  app.post("/api/articles", function (req, res) {
    db.Articles.create(req.body).then(function (dbArticles) {
      res.render("giphs", dbArticles);
    });
  });

};
