Friday 2 June 2017

remove re-export module default

How can I remove 'default' config.default.database.cluster?

config/env/development.js:

const config = {
    database: {
        cluster: '...',
        password: '',
        bucket: '...'
    }
}

export default config;

config/env/index.js:

const env = process.env.NODE_ENV || 'development';
const config = require(`./${env}.js`);

export default config;

config/db.js:

import config from './env';

const cluster = new couchbase.Cluster(config.default.database.cluster);



via Alvin

No comments:

Post a Comment