wikijs-fork/server/helpers/config.js

20 lines
359 B
JavaScript
Raw Normal View History

2017-05-15 00:17:08 +00:00
'use strict'
const _ = require('lodash')
module.exports = {
/**
* Parse configuration value for environment vars
*
* @param {any} cfg Configuration value
* @returns Parse configuration value
*/
parseConfigValue (cfg) {
return _.replace(
cfg,
2017-05-15 01:20:40 +00:00
(/\$\(([A-Z0-9_]+)\)/g,
(fm, m) => { return process.env[m] })
2017-05-15 00:17:08 +00:00
)
}
}