Skip to content
This repository has been archived by the owner on May 14, 2024. It is now read-only.

Commit

Permalink
Merge pull request #27 from SmolSoftBoi/main
Browse files Browse the repository at this point in the history
Fix use environment variable config
  • Loading branch information
Karen-boop authored Oct 14, 2022
2 parents 05b4c57 + b70215c commit 14e2c0a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion models/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ const db = {};

let sequelize;
if (config.use_env_variable) {
sequelize = new Sequelize(config);
if (process.env[config.use_env_variable]) {
sequelize = new Sequelize(process.env[config.use_env_variable]);
} else {
sequelize = new Sequelize(config);
}
} else {
sequelize = new Sequelize(
config.database,
Expand Down

0 comments on commit 14e2c0a

Please sign in to comment.