'use strict';

var env = require('./env.json');

function httpPost(req, cb) {
  var https = req.deps.https;
  console.log('env:', env);

  var postData = JSON.stringify({
    metadata: req.data.s3Object.Metadata,
    sizes: req.data.sizes
  });

  var options = {
    hostname: 'plaaant.com',
    port: 443,
    path: '/api/image-complete?token=' + env.PLANT_IMAGE_COMPLETE,
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
      'Content-Length': Buffer.byteLength(postData)
    }
  };

  var request = https.request(options, function() {});
  request.write(postData);
  request.end();

  cb();
}

module.exports = {
  httpPost: httpPost
};

@@ -508,16 +508,60 @@
 %7D%0A  %7D;%0A%0A
+  console.log('About to PUT to server...');%0A
   var re
@@ -655,14 +655,68 @@
 ();%0A
-%0A  cb(
+  console.log('Completed PUT to server...');%0A%0A  cb(null, req
 );%0A%7D

Add logging to server PUT