Not able to read the environment specific details
Hello Team,
I have created Adobe IO runtime project and trying to run in my local system. But, my logic is not picking the environment specific details.
Here is the .env file data
AIO_RUNTIME_AUTH=12345678
AIO_RUNTIME_NAMESPACE=123456-poc-testing
NODE_ENV=development
My node js file has
// Import the dotenv package to load environment variables
import dotenv from 'dotenv';
dotenv.config();
// Import default configuration
import defaultConfig from './default.js';
// Dynamically import the environment-specific configuration
const env = process.env.NODE_ENV || 'development';
console.log("end file is:",env,process.env.NODE_ENV);
const envConfigModule = await import(`./${env}.js`);
return envConfigModule.default;
// Export a function to get the merged configuration
const envConfig = await loadEnvConfig();
console.log("defaultConfig",defaultConfig)
return { ...defaultConfig, ...envConfig };
Here, instead of giving the data from development.js file, I am getting the value for production.js file
console.log("end file is:",env,process.env.NODE_ENV); This line gives me production.
Thanks in advance.
cc @amanath_ullah @sarav_prakash @mk_aem21 @arunpatidar @amitvishwakarma