@@ -75,14 +75,15 @@ app.get('/check', defaultLimiter, (req, res) => {
7575
7676 if ( showDetails ) {
7777 response . attributes = {
78+ version : swaggerDocument . info . version ,
7879 release_time : process . env . RELEASE_TIME ,
7980 env : process . env . ENV ,
8081 db_state : mongoose . connection . readyState ,
81- switcherapi : process . env . SWITCHER_API_ENABLE ,
82- switcherapi_logger : process . env . SWITCHER_API_LOGGER ,
83- relay_bypass_https : process . env . RELAY_BYPASS_HTTPS ,
84- relay_bypass_verification : process . env . RELAY_BYPASS_VERIFICATION ,
85- metrics : process . env . METRICS_ACTIVATED ,
82+ switcherapi : isEnabled ( ' SWITCHER_API_ENABLE' ) ,
83+ switcherapi_logger : isEnabled ( ' SWITCHER_API_LOGGER' ) ,
84+ relay_bypass_https : isEnabled ( ' RELAY_BYPASS_HTTPS' ) ,
85+ relay_bypass_verification : isEnabled ( ' RELAY_BYPASS_VERIFICATION' ) ,
86+ metrics : isEnabled ( ' METRICS_ACTIVATED' ) ,
8687 max_rpm : process . env . MAX_REQUEST_PER_MINUTE ,
8788 regex_max_timeout : process . env . REGEX_MAX_TIMEOUT ,
8889 regex_max_blacklist : process . env . REGEX_MAX_BLACKLIST ,
@@ -93,4 +94,8 @@ app.get('/check', defaultLimiter, (req, res) => {
9394 res . status ( 200 ) . send ( response ) ;
9495} ) ;
9596
97+ function isEnabled ( feature ) {
98+ return process . env [ feature ] ?. toLowerCase ( ) === 'true' ;
99+ }
100+
96101export default createServer ( app ) ;
0 commit comments