Skip to main content

Module config

Module config 

Source
Expand description

Runtime configuration for lora-server.

Resolves the bind address (host + port) from, in order of precedence:

  1. CLI flags: --host <HOST>, --port <PORT> (also accepts --host=<HOST>).
  2. Environment variables: LORA_SERVER_HOST, LORA_SERVER_PORT.
  3. Built-in defaults: 127.0.0.1:4747.

The default HTTP port for the local LoraDB server is 4747 — short, memorable, and outside the most common local development ports (3000/4000/5000/8000/8080/8443/9000) and standard database ports (Postgres 5432, Redis 6379, MongoDB 27017, Elasticsearch 9200, MySQL 3306) so it does not collide with typical side projects.

The parser also understands --help / --version, which return a ConfigOutcome variant instead of a ServerConfig so the binary can print and exit before booting the runtime.

Structs§

ServerConfig

Enums§

ConfigError
ConfigOutcome

Constants§

DEFAULT_HOST
DEFAULT_PORT
HOST_ENV
PORT_ENV
SNAPSHOT_PATH_ENV

Functions§

help_text
resolve
Resolve a ConfigOutcome from CLI args and explicit env values.
resolve_from_process
Resolve using the process environment and std::env::args.
version_text