I have a script section in my package.json file as shown below
"scripts": {
"start": "node_modules/.bin/grunt transpile && node dist/src/app.js",
}
when I run "npm start" from command shell it works fine. Now I have the requirement to introduce two environment variables which my js code is accessing as below
if (process.env.APP_DATA_MODE === "complete") {
// perform some actions here
} else {
// perform some actions here
}
if (process.env.HOST_NAME === "dev") {
// do some dev env related code here
} else {
// do prod related code here
}
What I want to know is how should I introduce these two environment variables in the "start" command above OR at the very least how I can run the npm start command and also specify arguments for the two environment variables listed above
Already tried stack overflow article which does look like a close match but having no luck there as the environment variable keep coming as blank during code execution