{"id":25560,"library":"express-cloudfoundry-actuator-middleware","title":"Express Cloud Foundry Actuator Middleware","description":"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.","status":"maintenance","version":"1.8.0","language":"javascript","source_language":"en","source_url":"https://github.com/stfsy/express-cloudfoundry-actuator-middleware","tags":["javascript","Cloud Foundry","CloudFoundry","cloudfoundry","Actuator","Spring Boot","Apps Manager","Middleware","Express"],"install":[{"cmd":"npm install express-cloudfoundry-actuator-middleware","lang":"bash","label":"npm"},{"cmd":"yarn add express-cloudfoundry-actuator-middleware","lang":"bash","label":"yarn"},{"cmd":"pnpm add express-cloudfoundry-actuator-middleware","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency: the middleware is designed to be used with Express applications.","package":"express","optional":true}],"imports":[{"note":"The package is CommonJS only; ESM import will fail.","wrong":"import actuator from 'express-cloudfoundry-actuator-middleware'","symbol":"default","correct":"const actuator = require('express-cloudfoundry-actuator-middleware')"},{"note":"actuator is a factory function that returns middleware; must be called.","wrong":"app.use(actuator)","symbol":"actuator","correct":"app.use(actuator())"},{"note":"Options are booleans, not an array; see README for full options.","wrong":"app.use(actuator({ endpoints: ['health','info'] }))","symbol":"options","correct":"app.use(actuator({ health: true, info: true }))"}],"quickstart":{"code":"const express = require('express');\nconst app = express();\nconst actuator = require('express-cloudfoundry-actuator-middleware');\n\n// Optional: configure endpoints\nconst options = {\n  health: true,\n  info: true\n};\n\napp.use(actuator(options));\n\napp.get('/', (req, res) => res.send('Hello World!'));\n\nconst PORT = process.env.PORT || 3000;\napp.listen(PORT, () => console.log(`App listening on port ${PORT}`));","lang":"javascript","description":"Sets up an Express app with the actuator middleware, enabling health and info endpoints for Cloud Foundry."},"warnings":[{"fix":"Place app.use(actuator()) before route definitions.","message":"The actuator middleware must be used before other routes to ensure endpoints are accessible.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use actuator({ health: true, info: true }) to explicitly enable endpoints.","message":"Options object is required; passing no arguments or undefined will still enable default endpoints, but any additional configuration must be passed explicitly.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Run the CLI tool before deployment: npx cloudfoundry-actuator-cli build-info","message":"The 'info' endpoint requires a build info file generated by Cloud Foundry Actuator CLI; without it, the endpoint may return empty or error.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use Node 16 or lower, or consider using the '--openssl-legacy-provider' flag if needed.","message":"Node engine requirement is >=6, which is end-of-life. The package may not work on modern Node versions (>=18) without compat flags.","severity":"deprecated","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use const actuator = require('express-cloudfoundry-actuator-middleware'); then call app.use(actuator());","cause":"actuator is imported as a default export but the package uses module.exports with a factory function.","error":"TypeError: actuator is not a function"},{"fix":"Run npm install express-cloudfoundry-actuator-middleware --save in your project root.","cause":"The package was not installed, or installed in the wrong directory.","error":"Cannot find module 'express-cloudfoundry-actuator-middleware'"},{"fix":"Ensure you use app.use(actuator()) and not app.get('/', actuator()).","cause":"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.","error":"Route.get() requires a callback function but got a [object Object]"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}