FlintSable
5/28/2017 - 11:53 PM

Sequelize Methods

Sequelize Methods

router.get("/:id", function(req, res, next){
  Article.findById(req.params.id).then(function(article){
    res.render("articles/show", {article: article, title: article.title});
  });

});
router.get('/', function(req, res, next) {
  Article.findAll({order:[["createdAt", "DESC"]] }).then(function(articles){
    res.render("articles/index", {articles: articles, title: "My Awesome Blog" });
  });
});