anda harus mengubah config.json
file ke config.js
modul dan pastikan untuk require
dotenv
di bagian paling atas.
require('dotenv').config(); // this is important!
module.exports = {
"development": {
"username": process.env.DB_USERNAME,
"password": process.env.DB_PASSWORD,
"database": process.env.DB_DATABASE,
"host": process.env.DB_HOST,
"dialect": "mysql"
},
"test": {
"username": "root",
"password": null,
"database": "database_test",
"host": "127.0.0.1",
"dialect": "mysql"
},
"production": {
"username": "root",
"password": null,
"database": "database_production",
"host": "127.0.0.1",
"dialect": "mysql"
}
};
CATATAN:perbarui .sequelizerc
untuk mencocokkan file konfigurasi baru.
"config": path.resolve('./config', 'config.js'),