Primo committ Notevole

This commit is contained in:
Paolo Arena
2019-12-28 11:16:53 +01:00
commit 5d32378df8
174 changed files with 29861 additions and 0 deletions

27
config/envparser.js Normal file
View File

@@ -0,0 +1,27 @@
const DotEnv = require('dotenv')
let path
switch (process.env.NODE_ENV) {
case 'test':
path = `.env.test`
break
case 'development':
path = `.env.development`
break
default:
path = `.env.production`
break
}
// console.log("PATH", path)
const parsedEnv = DotEnv.config({ path }).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
};