title: How to send the output of a AWS nodejs output to the browser rather than the terminal
body: <p>I'm writing up a nodejs application which should spit out the output to the screen rather than a console.log.</p>
  
  <p>My code:</p>
  
  <pre><code>var AWS = require('aws-sdk');
  AWS.config.update({accessKeyId: 'AK*************37D', secretAccessKey: 'DyP*****************************7THvRfro', region: 'ap-south-1'});
  var http=require('http')
  var server=http.createServer((function(request,response)
  {
      response.writeHead(200,
      {"Content-Type" : "text/plain"});
      response.end("Hello World\n");
  
  // Create S3 service object
  s3 = new AWS.S3({apiVersion: '2006-03-01'});
  
  //Call S3 to list the buckets
  s3.listBuckets(function(err, data) {
    if (err) {
      console.log("Error", err);
    } else {
      console.log("Success", data.Buckets);
    }
  });
  
  var params = { 
  
      Bucket: 'lfs-test-mb',
      Delimiter: '',
      //Prefix: 's/5469b2f5b4292d22522e84e0/ms.files' 
    }
  
    s3.listObjects(params, function (err, data) {
      if(err)throw err;
      console.log(data);
    });
  
  }));
  server.listen(7000);
  </code></pre>
  
  <p>This code works perfectly and I'm able to run "<a href="http://localhost:7000" rel="nofollow noreferrer">http://localhost:7000</a>" which returns the output to the terminal.</p>
  
  <pre><code>D:\AWS_NodeJS&gt;node lfs.js
  {
    IsTruncated: false,
    Marker: '',
    Contents: [
      {
        Key: '39e8e2ab94c5ca5388cecf49481a05738e1d6ceaf127a48202f2ea670f9755ec',
        LastModified: 2020-04-22T00:01:03.000Z,
        ETag: '"40a62c83b10fe56bc9894d60631992a5"',
        Size: 31457280,
        StorageClass: 'REDUCED_REDUNDANCY',
        Owner: [Object]
      },
      {
        Key: '4a474cd829d49e686e1a998b4700955e024a17e62d35eb576973429f9159f2e6',
        LastModified: 2020-04-24T04:56:32.000Z,
        ETag: '"eb0542a9e23c8bfcf756e747502722f4"',
        Size: 11690801,
        StorageClass: 'REDUCED_REDUNDANCY',
        Owner: [Object]
      },
    ],
    Name: 'lfs-test-mb',
    Prefix: '',
    MaxKeys: 1000,
    CommonPrefixes: []
  }
  </code></pre>
  
  <p>How can i send the response to the screen rather than the terminal????</p>