connect-rest
Advanced tools
Comparing version 0.0.45 to 0.0.46
@@ -6,3 +6,3 @@ /* | ||
*/ | ||
var VERSION = '0.0.45'; | ||
var VERSION = '0.0.46'; | ||
@@ -102,3 +102,3 @@ var connect = require('connect'); | ||
function process(req, res, matching, bodyObj){ | ||
function processRequest(req, res, matching, bodyObj){ | ||
logger.debug('Payload object: ', bodyObj ); | ||
@@ -289,3 +289,3 @@ | ||
if( req.body ){ | ||
process(req, res, matching, req.body); | ||
processRequest(req, res, matching, req.body); | ||
} else{ | ||
@@ -305,3 +305,3 @@ var body = ''; | ||
process(req, res, matching, bodyObj); | ||
processRequest(req, res, matching, bodyObj); | ||
} ); | ||
@@ -312,8 +312,33 @@ } | ||
exports.setupLogger = function(bunyan, options, logger){ | ||
var _logger = logger ? logger : new DummyLogger(); | ||
exports.createBunyanLogger = function(_bunyan, options){ | ||
return _bunyan.createLogger({ | ||
name: options.name, | ||
src: true, | ||
streams: [ | ||
(options.outFile ? { | ||
level: options.level || 'info', | ||
path: options.outFile | ||
} : { | ||
level: options.level || 'info', | ||
stream: process.stdout | ||
}), | ||
(options.errFile ? { | ||
level: 'error', | ||
path: options.errFile | ||
} : { | ||
level: 'error', | ||
stream: process.stdout | ||
}) | ||
] | ||
}); | ||
}; | ||
exports.setupLogger = function(_bunyan, options, _logger){ | ||
var logger = _logger ? _logger : new DummyLogger(); | ||
if( options ){ | ||
_logger = options.name ? bunyan.createLogger({name: options.name, src: true, level: options.level || 'info'}) : options; | ||
logger = options.name ? exports.createBunyanLogger( _bunyan, options ) : options; | ||
} | ||
return _logger; | ||
return logger; | ||
}; | ||
@@ -320,0 +345,0 @@ |
{ | ||
"name": "connect-rest", | ||
"version": "0.0.45", | ||
"version": "0.0.46", | ||
"description": "Exceptionally featureful RESTful web services middleware for Connect.", | ||
@@ -47,4 +47,4 @@ "keywords": [ | ||
}, | ||
"_id": "connect-rest@0.0.45", | ||
"_from": "connect-rest@>=0.0.45" | ||
"_id": "connect-rest@0.0.46", | ||
"_from": "connect-rest@>=0.0.46" | ||
} |
@@ -508,3 +508,3 @@ [connect-rest](https://github.com/imrefazekas/connect-rest) is a featureful very easy-to-use middleware for [connect](http://www.senchalabs.org/connect/) for building REST APIs. The library has a stunning feature list beyond basic rest functionality. | ||
- 0.0.43-45: Serious fixes | ||
- 0.0.43-46: Various fixes/improvements | ||
- 0.0.42: Incomint request count monitoring added | ||
@@ -511,0 +511,0 @@ - 0.0.41: listener for populated measurements can be set |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
86136
976