TypeError: Cannot read property \'findAll\' of undefined (expressjs).
All functions (sequelize) are not working. All errors: Cannot rea
You have created two instances of sequelize. One in models/index.js in line 12/14 and second instance in server script in line 19. And you start second instance, but in model you tried to use first instance.
Your model/index.js file is ok. In your server file add
var database = require('path/to/models');
change your db start to:
database.sequelize
.authenticate()
.then(function(err) {
console.log('Connection has been established successfully.');
}, function (err) {
console.log('Unable to connect to the database:', err);
});
And you have to pass 'database' object to your controllers instead of models = require('./../models');
and from your controllers you have access to your model : database.User