ports.yaml

Overview

The ports.yaml file is a configuration file that defines a set of named port numbers used by various components of the application or system. It serves as a central reference for network ports, enabling consistent and maintainable port assignments across the application infrastructure. This file facilitates easy updates to port numbers without requiring changes to the source code.

Content Description

The file consists of a YAML mapping of keys (port identifiers) to integer values (port numbers). Each key represents a specific service or endpoint within the system, and the corresponding value specifies the port number on which that service is expected to listen.

Defined Ports

Key

Port Number

Description

Q_SERVER_MAPPED_PORT

3000

Port for the Q server service.

BM_NODE_PORT

8600

Base port for the BM node component.

BM_API_PORT

8700

Port for BM API service.

BM_NODE_HTTP_URL_PORT

11000

HTTP URL port for BM node.

BM_NODE_STREAM_PORT

12000

Streaming port for BM node communication.

BM_REST_API_PORT

8600

REST API port for BM component, same as BM_NODE_PORT.

Usage

This file is intended to be loaded by configuration parsers within the application or deployment scripts to retrieve port numbers programmatically. By referencing these keys, the application can bind network listeners or configure clients to connect to the appropriate ports.

For example, in a Node.js service:

const config = require('yaml-config-loader').load('ports.yaml');
const port = config.Q_SERVER_MAPPED_PORT;

app.listen(port, () => {
  console.log(`Server running on port ${port}`);
});

This approach decouples port assignments from the application logic, improving flexibility and ease of configuration management.

Implementation Details

Interaction with Other System Parts

Visual Diagram

flowchart TD
Q_SERVER_MAPPED_PORT["Q_SERVER_MAPPED_PORT: 3000"]
BM_NODE_PORT["BM_NODE_PORT: 8600"]
BM_REST_API_PORT["BM_REST_API_PORT: 8600"]
BM_API_PORT["BM_API_PORT: 8700"]
BM_NODE_HTTP_URL_PORT["BM_NODE_HTTP_URL_PORT: 11000"]
BM_NODE_STREAM_PORT["BM_NODE_STREAM_PORT: 12000"]
BM_NODE_PORT --- BM_REST_API_PORT

For further details on topics related to network port configuration and service communication, see Network Configuration and Service Architecture.