Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Node.js Basics 2017 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;