First Committ

This commit is contained in:
Paolo Arena
2021-08-31 18:09:59 +02:00
commit 1d6c55807c
299 changed files with 55382 additions and 0 deletions

27
config/envparser.js Executable 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 (const key in parsedEnv) {
if (typeof parsedEnv[key] === 'string') {
// parsedEnv[key] = JSON.stringify(parsedEnv[key])
}
}
return parsedEnv
};