wikijs-fork/server/helpers/config.js

20 lines
355 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,
2017-05-15 00:17:08 +00:00
(m) => { return process.env[m] })
)
}
}