JavaScript Node.js Basics Create a Command Line Weather Application Retrieving Data - Solution

How to pass JSON when using google API

//this is my code-

const https = require('https'); const api = require('./app.json'); const http = require('/http');

function printWeather(weather) { constant message = 'Current temp in${weather location} is ${weather.current_observation.temp_f)F'; console.log("weather"); console.log("message"): }

function get(query) { const request = "https://maps.googleapis.com/maps/api/js?key=AIzaSyAhv5Mx2bMmwJJ7SjB1xfG_KMcsewbBA1s&callback=initMap"; https.get(request, response => {

let body= "";
response.on('data', chunk =>{
  body += chunk;{
  console.log("running");
  }
});
response.on('end',() =>{
            console.log("body");

      const wearther = JSON.parse(body);


});

}); }

module.exports = get;