Inicjalizacja bazy danych NodeJS
const sequelize = new Sequelize('DBNAME', 'USER', 'PASSWORD', { // create a sequelize instance (connect to DB)
dialect: "LANGAGE", // mysql, mariadb, etc...
host: "YOUR-HOST"
});
const initDB = () => {
sequelize.sync({force: true})
.then(_ => {
console.log('DB OK')
})
.catch(err => console.error('DB K.O', err));
}
// If not used in app.js
module.exports = {
initDB
}
Victorious Vole