I found myself in need of setting environment variables in heroku for the deployment in production mode of my project.
The variables were the credentials for accessing the data base
const DB_HOST = process.env.DB_HOST || 'localhost';
const DB_NAME = process.env.DB_NAME || 'nombre_base_dato';
const DB_USER = process.env.DB_USER || 'postgres';
const DB_PASS = process.env.DB_PASS || 'postgres';
const DB_CHARSET = process.env.DB_CHARSET || 'utf-8';
const DB_CLIENT = process.env.DB_CLIENT || 'postgresql';
module.exports = {
development: {
client: "postgresql",
connection: {
host: "localhost",
user: "postgres",
password: "postgres",
database: "abeedb",
charset: "utf-8"
}
},
production: {
client: DB_CLIENT,
connection: {
host: DB_HOST,
user: DB_USER,
password: DB_PASS,
database: DB_NAME,
charset: DB_CHARSET
}
}
}