Alguém poderia me ajudar? aparentemente esta dando erro ao se referenciar ao sequelize, na hora de puxar os dados do bd
segue codigo:
database.js
const Sequelize = require('sequelize');
const { Model } = require('sequelize/types');
const connection = new Sequelize('pokedex', 'root', 'Christian222', {
host: "localhost",
dialect: 'mysql'
})
module.exports = connection;
pokemons.js
const { Sequelize, DataTypes } = require('sequelize');
const sequelize = new Sequelize('mysql::memory:');
const Pokemons = sequelize.define('pokemons', {
Nome: {
type: DataTypes.STRING
},
PokedexNumber: {
type: DataTypes.INTEGER
}
}, {timestamps: false})
module.exports = Pokemons;
as rotas
const { Model } = require('sequelize/types');
const pokemons = require('../../config/pokemons');
module.exports = (app) => {
//ROTA INICIAL
app.get("/", function(req, res) {
pokemons.findAll({
atrributes: ['Nome', 'PokedexNumber']
}).then(function(){
res.marko( require('../views/pokedex/pokemons/pokemons.marko'), { pokemons: pokemons })
})
});
}