mirror of
https://github.com/20kaushik02/express-sequelize-backend-template.git
synced 2025-12-06 13:44:06 +00:00
overall: formatting check, jsdoc type hints, express res/return stuff utils - changes in logger, dateformatter and removed unneeded ones .env file changes license check, readme update package.json update - version, deps, URLs server cleanup sequelize config check
29 lines
758 B
JavaScript
29 lines
758 B
JavaScript
const logger = require("../utils/logger")(module);
|
|
|
|
const connConfigs = {
|
|
development: {
|
|
username: process.env.DB_USERNAME || 'postgres',
|
|
password: process.env.DB_PASSWORD || '',
|
|
database: process.env.DB_NAME || 'postgres',
|
|
host: process.env.DB_HOST || '127.0.0.1',
|
|
port: process.env.DB_PORT || 5432,
|
|
},
|
|
staging: {
|
|
use_env_variable: "DB_URL", // use connection string for non-dev env
|
|
},
|
|
production: {
|
|
use_env_variable: "DB_URL", // use connection string for non-dev env
|
|
// dialectOptions: {
|
|
// ssl: true,
|
|
// },
|
|
}
|
|
}
|
|
|
|
// common config
|
|
for (const conf in connConfigs) {
|
|
connConfigs[conf]['logging'] = (msg) => logger.debug(msg);
|
|
connConfigs[conf]['dialect'] = process.env.DB_DIALECT || 'postgres';
|
|
}
|
|
|
|
module.exports = connConfigs;
|