I would like to inspect some middleware options I am setting for express later in the code. For instance I am setting limits in json bodyParser as:
expressServer.use(bodyParser.json({
limit:1000000
}))
Then later in the code I would like to retrieve that value from the express instance for further needs.
To use this "limit" as a global variable would not be a desired solution.
You can store options in database or in a simple file:
And then access it by reading file
So you can call
readOptionsFromFile(callback)
from wherever you want.