github.com/cloudcredo/cloudrocker@v0.0.0-20160108110610-1320f8cc2dfd/sample-apps/node/node_modules/logfmt/examples/vanilla_http.js (about)

     1  var http = require('http');
     2  var logfmt = require('../logfmt');
     3  var through = require('through');
     4  
     5  http.createServer(function (req, res) {
     6    req.pipe(logfmt.streamParser())
     7       .pipe(through(function(object){
     8         console.log(object);
     9       }))
    10  
    11    res.writeHead(200, {'Content-Type': 'text/plain'});
    12    res.end('okay');
    13  }).listen(3000);