lib/request-extractors/express.js
function expressRequestInformationExtractor(req, res) {

  var returnObject = new RequestInformationContainer();

  if (!isObject(req) || !isFunction(req.header) || !isObject(res)) {

    return returnObject;
  }

  returnObject.setMethod(req.method)
      .setUrl(req.url)
      .setUserAgent(req.header('user-agent'))
      .setReferrer(req.header('referrer'))
      .setStatusCode(res.statusCode)
      .setRemoteAddress(extractRemoteAddressFromRequest(req));

  return returnObject;
}
function expressRequestInformationExtractor(req, res) {

  var returnObject = new RequestInformationContainer();

  if (!isObject(req) || !isFunction(req.header) || !isObject(res)) {

    return returnObject;
  }

  returnObject.setMethod(req.method)
      .setUrl(req.url)
      .setUserAgent(req.header('user-agent'))
      .setReferrer(req.header('referrer'))
      .setStatusCode(res.statusCode)
      .setRemoteAddress(extractRemoteAddressFromRequest(req));

  return returnObject;
}
function expressRequestInformationExtractor ( req , res ) { var returnObject = new RequestInformationContainer ( ) ; if ( ! isObject ( req ) || ! isFunction ( req . header ) || ! isObject ( res ) ) { return returnObject ; } returnObject . setMethod ( req . method ) . setUrl ( req . url ) . setUserAgent ( req . header ( 'user-agent' ) ) . setReferrer ( req . header ( 'referrer' ) ) . setStatusCode ( res . statusCode ) . setRemoteAddress ( extractRemoteAddressFromRequest ( req ) ) ; return returnObject ; }
The expressRequestInformationExtractor is a function which is made to extract
request information from a express request object. This function will do a
basic check for type and method presence but will not check for the presence
of properties on the request object.
@function expressRequestInformationExtractor
@param {Object} req - the express request object
@param {Object} res - the express response object
@returns {RequestInformationContainer} - an object containing the request
information in a standardized format
The expressRequestInformationExtractor is a function which is made to extract request information from a express request object . This function will do a basic check for type and method presence but will not check for the presence of properties on the request object .