Registry / devops / express-cloudfoundry-actuator-middleware

express-cloudfoundry-actuator-middleware

JSON →
library1.8.0jsnpmunverified

Express middleware providing health and info endpoints for Cloud Foundry Apps Manager, inspired by Spring Boot Actuator. Current stable version is 1.8.0 (released May 2021), with maintenance-level updates addressing dependency vulnerabilities. Key differentiators: integrates natively with Cloud Foundry's Apps Manager UI, restricts endpoints to authenticated/authorized users, and works with the companion CLI to generate build info files. Compatible with Node 6+ (legacy engine requirement). Provides only health and info endpoints (no metrics, environment, or other Spring Boot actuator endpoints). Last release was over 3 years ago; no active development expected.

npm install express-cloudfoundry-actuator-middleware
INSTALL
IMPORT
SIG · EXPRESS-CLOUDFOUND
E
express-cloudfoundry-actuator-middleware
devopsjavascriptv1.8.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
const actuator = require('express-cloudfoundry-actuator-middleware')
import actuator from 'express-cloudfoundry-actuator-middleware'
The package is CommonJS only; ESM import will fail.
actuator
app.use(actuator())
app.use(actuator)
actuator is a factory function that returns middleware; must be called.
options
app.use(actuator({ health: true, info: true }))
app.use(actuator({ endpoints: ['health','info'] }))
Options are booleans, not an array; see README for full options.

Sets up an Express app with the actuator middleware, enabling health and info endpoints for Cloud Foundry.

const express = require('express'); const app = express(); const actuator = require('express-cloudfoundry-actuator-middleware'); // Optional: configure endpoints const options = { health: true, info: true }; app.use(actuator(options)); app.get('/', (req, res) => res.send('Hello World!')); const PORT = process.env.PORT || 3000; app.listen(PORT, () => console.log(`App listening on port ${PORT}`));
Debug
Known issues
gotchaThe actuator middleware must be used before other routes to ensure endpoints are accessible.
fix
Place app.use(actuator()) before route definitions.
affects: >=1.0.0
gotchaOptions object is required; passing no arguments or undefined will still enable default endpoints, but any additional configuration must be passed explicitly.
fix
Use actuator({ health: true, info: true }) to explicitly enable endpoints.
affects: >=1.0.0
gotchaThe 'info' endpoint requires a build info file generated by Cloud Foundry Actuator CLI; without it, the endpoint may return empty or error.
fix
Run the CLI tool before deployment: npx cloudfoundry-actuator-cli build-info
affects: >=1.0.0
deprecatedNode engine requirement is >=6, which is end-of-life. The package may not work on modern Node versions (>=18) without compat flags.
fix
Use Node 16 or lower, or consider using the '--openssl-legacy-provider' flag if needed.
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: actuator is not a function
actuator is imported as a default export but the package uses module.exports with a factory function.
fix
Use const actuator = require('express-cloudfoundry-actuator-middleware'); then call app.use(actuator());
Cannot find module 'express-cloudfoundry-actuator-middleware'
The package was not installed, or installed in the wrong directory.
fix
Run npm install express-cloudfoundry-actuator-middleware --save in your project root.
Route.get() requires a callback function but got a [object Object]
actuator() returns an object with router functions, but it's not a direct middleware; calling actuator() without using it in app.use() leads to this error.
fix
Ensure you use app.use(actuator()) and not app.get('/', actuator()).
Upgrade
Version history
1.8.0latest on npm
Audit
Dependencies
expressoptionalPeer dependency: the middleware is designed to be used with Express applications.
Agent activity
2 hits · last 30 days
node
2
Resources
express-cloudfoundry-actuator-middleware — npm install express-cloudfoundry-actuator-middleware · libregistry