Sometimes I don't have access to app
let's say in my Database Pool singleton and I need a way to detect the environment while instantiating pools and other resources etc, retrieve development or production configs.
I tried to lookup process
object and process.env
but couldn't find much.
Wondering if there's another way to detect the environment, I came across passing variables when running app.js
but it's not possible in the production environment, so any other suggestions please.
or as a last resort, I'll add a variable to process.env object in a cautious manner.