Skip to content
Snippets Groups Projects
Commit bb7f77a5 authored by Rudolf Copi Eckelberg's avatar Rudolf Copi Eckelberg
Browse files

Moved config files to config folder

parent fac54082
No related branches found
No related tags found
2 merge requests!116Release v1.0.0,!25Auth
Pipeline #
File moved
File moved
...@@ -46,10 +46,10 @@ gulp.task('compile', () => { ...@@ -46,10 +46,10 @@ gulp.task('compile', () => {
.pipe(gulp.dest('build')); // move compiled files to build directory .pipe(gulp.dest('build')); // move compiled files to build directory
// copy configuration file to build directory // copy configuration file to build directory
gulp.src('config.json') gulp.src('config/config.json')
.pipe(gulp.dest('build')); .pipe(gulp.dest('build/config'));
gulp.src('test_config.json') gulp.src('config/test_config.json')
.pipe(gulp.dest('build')); .pipe(gulp.dest('build/config'));
}); });
gulp.task('build', ['compile']); gulp.task('build', ['compile']);
......
const nconf = require('nconf'); const nconf = require('nconf');
const CONFIG_DIR = `config`
let config_file; let config_file;
switch(process.env.NODE_ENV) { switch(process.env.NODE_ENV) {
case 'development': case 'development':
config_file = 'config.json'; config_file = `${CONFIG_DIR}/config.json`;
break; break;
case 'test': case 'test':
config_file = 'test_config.json'; config_file = `${CONFIG_DIR}/test_config.json`;
break; break;
case 'production': case 'production':
config_file = 'config.json'; config_file = `${CONFIG_DIR}/config.json`;
break; break;
} }
...@@ -19,6 +20,4 @@ nconf.argv() ...@@ -19,6 +20,4 @@ nconf.argv()
.env() .env()
.file({ file: `${process.cwd()}/${config_file}` }); .file({ file: `${process.cwd()}/${config_file}` });
console.log(nconf.get('mongodb'));
module.exports = nconf; module.exports = nconf;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment