express-service-readiness-middleware
Advanced tools
Comparing version 1.0.1 to 1.0.3
{ | ||
"name": "express-service-readiness-middleware", | ||
"version": "1.0.1", | ||
"description": "This module provides Express middleware for determining whether routes are exposed based on service dependency health.", | ||
"version": "1.0.3", | ||
"description": "This module provides express middleware for determining whether routes are exposed based on service critical dependency health.", | ||
"repository": { | ||
@@ -6,0 +6,0 @@ "type": "git", |
# express-service-readiness-middleware | ||
This module provides express middleware for determining whether routes are exposed based on service critical dependency health. | ||
This module provides express middleware for determining whether routes are exposed based on service critical dependency health. | ||
Routes will still be exposed if non-critical dependencies are not ready. | ||
When critical dependencies are not ready a `502` status code will be returned for non whitelisted routes. | ||
Routes can also be whitelisted to be exposed if critical dependencies are not yet ready. | ||
Routes will still be exposed if non-critical dependencies are not ready! | ||
Specific routes can also be whitelisted to be exposed if critical dependencies are not yet ready. | ||
## Installation | ||
@@ -43,3 +45,3 @@ | ||
// register the middleware, ideally you would do this before all other middlware | ||
const config:IConfig = { whitelistedPaths: [ '/liveness' ]} | ||
const config = { whitelistedPaths: [ '/liveness' ]} | ||
app.use(createReadinessMiddleware(dependencies, config)) | ||
@@ -66,6 +68,6 @@ | ||
## create the middleware | ||
## createReadinessMiddleware | ||
```js | ||
const readinessMiddleware = createReadinessMiddleware(dependencies, options) | ||
const readinessMiddleware = createReadinessMiddleware(dependencies, config) | ||
``` | ||
@@ -84,3 +86,3 @@ | ||
### options (optional) | ||
### config (optional) | ||
@@ -87,0 +89,0 @@ - `retryIntervalInMilliseconds`: (default: `2000`) Interval in milliseconds in which to check if a dependency is ready. |
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
123
48164
9
724