Openweather api - 502 Bad Gateway Error

nodejs

#1

Hi I’m still pretty new to Node and I’m trying to work with openweather api. Below is the code I wrote. I’m using the Request package from npm to work with this api. The problem I’m having is that every time I try to run the application it takes long to run and it ends up giving me a bad gateway error. I did research on the error and found that openweather only response to http and not https. I also saw that it should be resolved by opening the application in a new tab on the browser using http but I still get the same error. I don’t know if its the way I’m using the request or if it has to do with http and https. Any help would be appreciated. Thank you.