on-http serves as the primary HTTP server component for the RackHD infrastructure management system, providing the web user interface and RESTful API endpoints essential for managing bare-metal hardware. Currently at its stable version 2.60.7, the project exhibits a consistent release cadence with frequent patch updates, indicating active development and maintenance. It is deployed as a standalone application, mandating the presence and correct configuration of external MongoDB and RabbitMQ instances for its operation. Its key differentiators lie in its deep integration with RackHD's capabilities for automated hardware provisioning, discovery, and orchestration, offering a structured API that defaults to version 2.0, with version 1.1 explicitly deprecated. The package also includes built-in tools for generating API documentation, task documentation, and client libraries for various programming languages, facilitating ecosystem integration.
npm install on-httpVerified import paths — ran on the pinned version, not inferred.
This script demonstrates how to install `on-http`, generate its documentation, start the server in the background, perform basic `curl` requests to its UI and API endpoints, and then gracefully shut it down. It highlights the prerequisite external services (MongoDB, RabbitMQ) and the common practice of using `sudo` to run the server.
Ensure MongoDB and RabbitMQ services are installed, started, and configured to be reachable from the `on-http` server. Check logs for connection errors during startup.
Update all API calls to utilize the 2.0 API, typically by prefixing endpoints with `/api/2.0/` or `/api/current/`. Refer to RackHD's readthedocs for functional differences and migration guides.
Prefer running the application under a dedicated, unprivileged user account. If port 80/443 access is required, use a reverse proxy (e.g., Nginx, Apache) or grant specific port permissions (e.g., using `authbind` or `setcap`).
Install `node-inspector` globally (`npm install node-inspector -g`), start it in the background (`node-inspector --preload=false &`), and then launch `on-http` with debugging enabled (`sudo DEBUG=express:* node --debug-brk index.js`).
Verify that MongoDB is running and listening on the expected port (default 27017). Check network connectivity and MongoDB configuration settings.
Ensure the RabbitMQ service is active and listening on its configured port (default 5672). Review RabbitMQ logs for startup issues.
Inspect the configuration files (e.g., `./config/default.json` or environment variables) to ensure the `fileService` object exists and contains a `defaultBackend` key with a valid backend string, as well as configurations for all defined backends.