TypeError: Cannot read property 'findAll' of undefined (expressjs).ТипError: Не удается прочитать свойство 'findAll' of undefined (expressjs)
Все функции (sequelize) не работают. Все ошибки: Не удается прочитать свойство 'метод sequelize' ...
module.exports = function (sequelize, DataTypes) {
var User = sequelize.define('user', {
email: {type: DataTypes.STRING(32), unique: true, allowNull: false},
});
return User;
};
Контроллер:
models = require('./../models');
exports.index = function (request, response, next) {
models.User.findAll({attributes: ['id', 'username']});
};
напишите содержимое своего ./../models/index.js или если вы создаете модели нестандартным способом, напишите об этом вместо этого. –
@KrzysztofSztompka, http://pastebin.com/Ev5Mp2AD –
спасибо, напишите, как вы запустите db –