"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Class which generated string content for configuration file (based on env variable)
*
* @export
* @class Config
*/
var Config = (function () {
function Config() {
}
/**
* Generate config file string content based on env variable
* @return {string} - string generated content
*/
Config.prototype.getConfig = function () {
return "module.exports = {\n development: {\n morgan: 'dev',\n APP_PORT: process.env.PORT || 3000\n },\n production: {\n morgan: 'combined',\n APP_PORT: process.env.PORT || 3000\n }\n};";
};
/**
* Generate index file string content from /config folder which returns Environment variables by ENV key
* @return {string} - string generated content
*/
Config.prototype.getEnvBasedConfig = function () {
return "const config = require('./config');\n\nmodule.exports = {\n getEnvBasedConfig: () => {\n return (config[process.env.NODE_ENV] || config['development']);\n }\n};";
};
return Config;
}());
exports.Config = Config;
exports.default = new Config();
|