Comparing version 0.1.0-beta-46 to 0.1.0-beta-48
@@ -243,2 +243,30 @@ "use strict"; | ||
* @author Igor Ivanovic | ||
* @method Request#forwardUrl | ||
* | ||
* @description | ||
* Forward to route | ||
*/ | ||
forwardUrl: function Request_forwardUrl(url) { | ||
var request; | ||
if (this.url === url) { | ||
throw new error.HttpError(500, { | ||
url: url | ||
}, 'Cannot forward to same url'); | ||
} else { | ||
this.stopPromiseChain(); | ||
request = new Request({ | ||
request: this.request, | ||
response: this.response, | ||
isForwarded: true, | ||
body: this.body | ||
}, url); | ||
logger.print('Request.forward.url', url); | ||
return request.parse(); | ||
} | ||
}, | ||
/** | ||
* @since 0.0.1 | ||
* @author Igor Ivanovic | ||
* @method Request#forward | ||
@@ -269,3 +297,3 @@ * | ||
logger.print('Request.forward', route, params); | ||
logger.print('Request.forward.route', route, params); | ||
@@ -420,3 +448,3 @@ return request.parse(); | ||
// log error request | ||
logger.print('Request.error',{ | ||
logger.print('Request.error', { | ||
url: this.url, | ||
@@ -423,0 +451,0 @@ status: this.statusCode, |
@@ -38,3 +38,4 @@ "use strict"; | ||
pattern: this.config.errorUrl, | ||
route: this.config.errorRoute ? this.config.errorRoute : 'core/error' | ||
route: this.config.errorRoute ? this.config.errorRoute : 'core/error', | ||
method: ['GET', 'HEAD', 'POST', 'PUT', 'DELETE', 'TRACE', 'OPTIONS', 'CONNECT', 'PATCH'] | ||
}); | ||
@@ -41,0 +42,0 @@ }, |
@@ -5,3 +5,3 @@ { | ||
"description": "Powerful lightweight mvc framework for nodejs", | ||
"version": "0.1.0-beta-46", | ||
"version": "0.1.0-beta-48", | ||
"dependencies" : { | ||
@@ -8,0 +8,0 @@ "mongoose": "3.8.x", |
129375
4133