Here is my config code, I made this using sequelize-cli and then I try to change the code using es6-module. Is there something wrong with this code ?
import "dotenv/config.js";
const {
DB_HOST,
DB_USER,
DB_PASSWORD,
DB_NAME
} = process.env;
export default {
"development": {
"username": DB_USER,
"password": DB_PASSWORD,
"database": DB_NAME,
"host": DB_HOST,
"dialect": "mysql"
},
"test": {
"username": "root",
"password": null,
"database": "database_test",
"host": "127.0.0.1",
"dialect": "mysql"
},
"production": {
"username": DB_USER,
"password": DB_PASSWORD,
"database": DB_NAME,
"host": DB_HOST,
"dialect": "mysql"
}
}
and this my package.json. I have tried to looking for the solution for this problem but I still cant to solve this, anyone can help me ?
{
"name": "api_skripsi",
"version": "1.0.0",
"description": "",
"type": "module",
"main": "app.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"dotenv": "^16.0.0",
"express": "^4.17.3",
"mysql2": "^2.3.3",
"sequelize": "^6.17.0"
},
"devDependencies": {
"husky": "^7.0.4"
}
}