Files
myDrive/backend/enviroment/getEnvVariables.ts
T
subnub 6518094410 init
2024-06-08 19:23:34 -04:00

20 lines
634 B
TypeScript

import path from "path";
const getEnvVariables = () => {
const configPath = path.join(__dirname, "..", "..", "config");
const processType = process.env.NODE_ENV;
console.log("123process", processType);
if (processType === "production" || processType === undefined) {
require("dotenv").config({ path: configPath + "/prod.env" });
} else if (processType === "development") {
require("dotenv").config({ path: configPath + "/dev.env" });
} else if (processType === "test") {
require("dotenv").config({ path: configPath + "/test.env" });
}
};
export default getEnvVariables;
module.exports = getEnvVariables;