Altra conversione in Typescript , partendo da un progetto di esempio funzionante...

This commit is contained in:
paolo
2018-11-02 22:15:48 +01:00
parent 6b00f242ee
commit 899e412949
14 changed files with 315 additions and 294 deletions

12
config/envparser.js Normal file
View File

@@ -0,0 +1,12 @@
const DotEnv = require('dotenv').config({ debug: process.env.DEBUG })
const parsedEnv = DotEnv.config().parsed;
module.exports = function () {
// Let's stringify our variables
for (key in parsedEnv) {
if (typeof parsedEnv[key] === 'string') {
parsedEnv[key] = JSON.stringify(parsedEnv[key])
}
}
return parsedEnv
};

3
config/helpers/env.js Normal file
View File

@@ -0,0 +1,3 @@
module.exports = function (key, fallback) {
return process.env[key] || fallback
}