application.js
function postDecode(request) {
    return new Promise(function promisePostDecode(resolve) {
      var postData = '';
      if (request.method === 'POST') {
        request.on('data', function (chunk) {
          // append the current chunk of data to the fullBody variable
          postData += chunk.toString();
        });

        request.on('end', function () {
          request.body = qs.parse(postData);
          resolve();
        });

      } else {
        resolve();
      }
    });
  }
function postDecode(request) {
    return new Promise(function promisePostDecode(resolve) {
      var postData = '';
      if (request.method === 'POST') {
        request.on('data', function (chunk) {
          // append the current chunk of data to the fullBody variable
          postData += chunk.toString();
        });

        request.on('end', function () {
          request.body = qs.parse(postData);
          resolve();
        });

      } else {
        resolve();
      }
    });
  }
function postDecode ( request ) { return new Promise ( function promisePostDecode ( resolve ) { var postData = '' ; if ( request . method === 'POST' ) { request . on ( 'data' , function ( chunk ) { // append the current chunk of data to the fullBody variable postData += chunk . toString ( ) ; } ) ; request . on ( 'end' , function ( ) { request . body = qs . parse ( postData ) ; resolve ( ) ; } ) ; } else { resolve ( ) ; } } ) ; }
Decode post data and add input into request
@param request
@returns {Promise}
Decode post data and add input into request