cliffordfajardo commented on code in PR #2417:
URL: https://github.com/apache/helix/pull/2417#discussion_r1145565587


##########
helix-front/server/app.ts:
##########
@@ -27,6 +35,17 @@ if (APP_INSIGHTS_CONNECTION_STRING) {
     .start();
 }
 
+if (httpsProxyAgent && process.env.NODE_ENV === 'production') {
+  // NOTES:
+  //
+  // - `defaultClient` property on `appInsights` doesn't exist
+  // until `.start` is called
+  //
+  // - in development on our laptop (as opposed to a server)
+  // we don't need to go through a proxy.
+  appInsights.defaultClient.config.httpsAgent = httpsProxyAgent;
+}
+
 const app = express();
 const server = http.createServer(app);
 

Review Comment:
   changes look good to me
   you can actually test this by removing  
`appInsights.defaultClient.config.httpsAgent = httpsProxyAgent;` out of the 
`if` block
   
   Using the proxy agent during localhost dev works too
   that way you can verify it doesn't crash or anything like that, then you can 
leave the as you have it in the `if` block



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to