bmcweb as a design goal should try to have no non-const global variables. Most of these variables can be thought of as general application state, and should be put in the App object. We used global variables initially because we didn't have access to modify the App object, as it was a template that individual callers didn't have access to without also being a template.
bmcweb as a design goal should try to have no non-const global variables. Most of these variables can be thought of as general application state, and should be put in the App object. We used global variables initially because we didn't have access to modify the App object, as it was a template that individual callers didn't have access to without also being a template.
But times have changed, and that issue has been fixed, so we can now just directly call to and from app when making our requests. One such example of a non-const, nontrivial global variable is in the websocket monitor class: https://github.com/openbmc/bmcweb/blob/65f7365901fad2437456f4edcdac41e03f0ca259/include/dbus_monitor.hpp#L25