How to integrate Express.js and Sequelize - Part 2

October 6, 2017 3 Min

This article will continued Part 1, in the part 1 we create two models, in the part 2 we will know how to use model to do CRUD(Create, Read, Update, Delete).

If you are lost, do not know what is this, you may read part 1 first.

0x00

We need a page to display master information, first edit your index route in the routes directory, it could look likes below.

1
2
3
4
5
6
7
8
9
var express = require('express');
var router = express.Router();

/* GET home page. */
router.get('/', function(req, res, next) {
  res.render('index', { title: 'Express' });
});

module.exports = router;