
var esHost = process.env.ES_HOST // elasticsearch host name

var ES = require('elasticsearch');

var esClient = new ES.Client({

    host: esHost,
    log: 'trace'

});

var tomatoLogger = require('es-logger').create({

    host: esHost,
    name: 'tomato-data'

});


module.exports = function (app) {
    'use strict';

    app.put('/api/tomato', function (req, res) {

        var params = req.body || {};

        params.started_at = new Date().getTime();

        params.user_id = '1'; // me

        tomatoLogger.info(params);

        res.json(params);

    });

    app.get('/api/tomato', function (req, res) {

        esClient.search({

            type: 'logs'

        }).then(function (resp) {

            console.log(resp);

            res.json(resp.hits);

        });

    });

};

@@ -560,24 +560,25 @@
 ;%0A%0A    %7D);%0A%0A
+%0A
     app.get(
@@ -707,40 +707,8 @@
  %7B%0A%0A
-            console.log(resp);%0A%0A
     
@@ -759,11 +759,12 @@
    %7D);%0A%0A
+%0A
 %7D;%0A

Remove debug log