Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

express-service-readiness-middleware

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-service-readiness-middleware - npm Package Compare versions

Comparing version 1.0.1 to 1.0.3

4

package.json
{
"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.

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc