setting up dotenv and stuff

This commit is contained in:
talksik
2022-04-01 11:46:08 -04:00
parent 8a1163dc3f
commit ce0fb7a885
9 changed files with 101 additions and 263 deletions
+14
View File
@@ -0,0 +1,14 @@
import dotenv from "dotenv";
if (process.env && process.env.NODE_ENV === "development") {
dotenv.config({ path: ".env.development" });
} else {
dotenv.config({ path: ".env" });
}
export const loadConfig = () => {
return {
MONGO_CONNECTION_STRING: process.env.MONGO_CONNECTION_STRING!,
JWT_TOKEN_SECRET: process.env.JWT_TOKEN_SECRET!,
};
};