@springernature/backend-proxy
Advanced tools
Comparing version 2.0.0 to 2.0.1
# History | ||
## 2.0.1 | ||
_05/06/20_ | ||
- Returns client error status codes from the backend and only raises errors if the backend responds with `500 - 599`. ([springerBuck](https://github.com/springerBuck)) | ||
## 2.0.0 | ||
@@ -4,0 +9,0 @@ _06/05/20_ |
{ | ||
"name": "@springernature/backend-proxy", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Proxies frontend requests to a backend and can render the result", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -21,3 +21,3 @@ # backend-proxy | ||
The `backend-proxy` middleware will take all incoming HTTP requests and forward them to a backend service. The backend response will then be stored on the original HTTP request to be used by your application, or automatically rendered using `render-backend-response`. | ||
The `backend-proxy` middleware will take all incoming HTTP requests and forward them to a backend service. The backend response will then be stored on the original HTTP request to be used by your application, or automatically rendered using `render-backend-response`. The status code from the backend will also be returned, this includes client errors (40X). However, server errors (50X) will result in an error being raised. | ||
@@ -24,0 +24,0 @@ ```js |
@@ -54,3 +54,3 @@ const http = require('http'); | ||
// Should we intercept the error and raise it as an express error | ||
if (backendResponse.statusCode >= 400 && backendResponse.statusCode <= 599) { | ||
if (backendResponse.statusCode >= 500 && backendResponse.statusCode <= 599) { | ||
return next({statusCode: backendResponse.statusCode}); | ||
@@ -57,0 +57,0 @@ } |
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
18533