Q:

How to reuse the same sequelize connection anywhere in my Express app? 

Here is my problem, I have an Express app where I separate the controllers (i.e. the functions called for each route) from the application entry point:
index.js
...
const sequelize = new Sequelize(...);
const PersonController = require('controllers/PersonController');
router.route('/persons').get(PersonController.index)
...

controllers/PersonController.js
...
exports.index = (req, res) => {
  //Return all the lines of the `Persons` table
};
...

But to access the database, I must have access to the sequelize instance in my controllers.  How should I do? 
Thank you for your help. 

A:

There are a lot of ways...
My favorite : you can create your constroller as a class...
Here is a kind of code, (not the best, but something running)
Controller class
class PersonController {
      constructor(sequelize) {
           this.sequelize = sequelize;
      }

      index(req, res){
           const sequelize = sequelize;
           ... your code ...
      }

}

module.exports = PersonController;

After
const sequelize = new Sequelize(...);
const PersonController = require('controllers/PersonController');

router.route('/persons').get((req, res) => {
     const controller = new PersonController(sequelize);
     controller.index(req, res);
})

