respond json object with node.js

I have the following code:

var http = require('http')
  ,https = require('https')
  ,fs = require('fs'),json;

var GOOGLE_API_KEY = process.env.GOOGLE_API_KEY;

var FUSION_TABLE_ID = "1epTUiUlv5NQK5x4sgdy1K47ACDTpHH60hbng1qw";

var options = {
  hostname: 'www.googleapis.com',
  port: 443,
  path: "/fusiontables/v1/query?sql=SELECT%20*%20"+FUSION_TABLE_ID+"FROM%20&key="+GOOGLE_API_KEY,
  method: 'GET'
};

http.createServer(function (req, res) {
  var file = fs.createWriteStream("chapters.json");
  var req = https.request(options, function(res) {
    res.on('data', function(data) {
      file.write(data);
    }).on('end', function() {
      file.end();
    });
  });
  req.end();
  req.on('error', function(e) {
    console.error(e);
  });
  console.log(req);
  res.writeHead(200, {'Content-Type': 'application/json'});
  res.end('Hello JSON');

}).listen(process.env.VMC_APP_PORT || 8337, null);

how do i return the json object rather then the 'Hello JSON'?

Don't store the received data in a file, put it in a local variable instead, and then send that variable in res.end():

var clientRes = res;
var json = '';

var req = https.request(options, function(res) {
    res.on('data', function(data) {
        json += data;
    }).on('end', function() {
        // send the JSON here
        clientRes.writeHead(...);
        clientRes.end(json);
    });
});

Note that you have two res variables - one for the response you're sending back to your own clients, and one which is the response you're receiving from Google. I've called the former clientRes.

Alternatively, if you're just going to proxy the information unmodified, you can just put clientRes.write(data, 'utf8') inside the res.on('data') callback:

http.createServer(function (clientReq, clientRes) {

    var req = https.request(options, function(res) {
        res.on('data', function(data) {
            clientRes.write(data, 'utf8');
        }).on('end', function() {
            clientRes.end();
        });

    clientRes.writeHead(200, {'Content-Type: 'application/json'});
    clientReq.end().on('error', function(e) {
        console.error(e);
    });

});