Skip to content
Snippets Groups Projects
Commit 48ae5259 authored by Alexis's avatar Alexis
Browse files

Added index.js config file

parent 97072b4d
Branches main
No related tags found
No related merge requests found
const logger = require("../loaders/logger");
// Set the NODE_ENV to 'development' by default
process.env.NODE_ENV = process.env.NODE_ENV || "development";
let file;
if (process.env.CI_JOB_STAGE) {
file = "./ci.env";
} else {
file = "./.env";
}
const envFound = require("dotenv").config({ path: file });
if (!envFound) {
logger.error("⚠️ Couldn't find .env config file ⚠️", { tag: "config" });
// This error should crash whole process
throw new Error("⚠️ Couldn't find .env config file ⚠️");
} else {
logger.setup("Config loaded 🔥 !", { tag: "config" });
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment