1
0
ohmyform/config/init.js

32 lines
849 B
JavaScript
Raw Normal View History

2015-06-29 15:51:29 -07:00
'use strict';
/**
* Module dependencies.
*/
var glob = require('glob'),
chalk = require('chalk');
/**
* Module init function.
*/
module.exports = function() {
/**
* Before we begin, lets set the environment variable
* We'll Look for a valid NODE_ENV variable and if one cannot be found load the development NODE_ENV
*/
2015-11-06 12:21:52 -08:00
var environmentFiles = glob.sync('./config/env/' + process.env.NODE_ENV + '.js');
2016-04-10 14:23:13 -07:00
console.log('process.env.MAILER_EMAIL_ID: '+process.env.MAILER_EMAIL_ID );
2015-11-06 12:21:52 -08:00
if (!environmentFiles.length) {
if (process.env.NODE_ENV) {
console.error(chalk.red('No configuration file found for "' + process.env.NODE_ENV + '" environment using development instead'));
} else {
console.error(chalk.red('NODE_ENV is not defined! Using default development environment'));
2015-06-29 15:51:29 -07:00
}
2015-11-06 12:21:52 -08:00
process.env.NODE_ENV = 'development';
}
2015-06-29 15:51:29 -07:00
};