Skip to main content
This page documents all environment variables used by the EPR LAPS Backend API. Variables are extracted from the application configuration in src/config.js.

Application Configuration

Service Identity

SERVICE_VERSION
string
default:"null"
The service version, injected into your Docker container in CDP environments.Nullable: Yes

Server Configuration

HOST
ipaddress
default:"0.0.0.0"
The IP address to bind the server to.Format: Valid IP address
PORT
port
default:"3001"
The port to bind the server to.Format: Valid port number (1-65535)

Environment

ENVIRONMENT
string
default:"local"
The CDP environment the application is running in.Allowed values:
  • local - Local development
  • infra-dev - Infrastructure development
  • management - Management environment
  • dev - Development environment
  • test - Test environment
  • perf-test - Performance testing
  • ext-test - External testing
  • prod - Production environment

Logging Configuration

LOG_ENABLED
boolean
default:"true"
Enable or disable logging.Default: true (disabled in test mode)
LOG_LEVEL
string
default:"debug"
Logging level for the application.Allowed values:
  • fatal - Only fatal errors
  • error - Error messages
  • warn - Warning messages
  • info - Informational messages
  • debug - Debug messages
  • trace - Trace messages
  • silent - No logging
LOG_FORMAT
string
default:"pino-pretty (dev) / ecs (prod)"
Format to output logs in.Allowed values:
  • ecs - Elastic Common Schema format (used in production)
  • pino-pretty - Human-readable format (used in development)
In production, sensitive paths like req.headers.authorization, req.headers.cookie, and res.headers are automatically redacted from logs.

MongoDB Configuration

MONGO_URI
string
default:"mongodb://127.0.0.1:27017/"
URI for MongoDB connection.Format: Valid MongoDB connection stringExample: mongodb://mongodb:27017/
MONGO_DATABASE
string
default:"epr-laps-backend"
Database name for MongoDB.

MongoDB Options

These options are configured in code and cannot be set via environment variables:
  • retryWrites: false - Disable MongoDB write retries
  • readPreference: secondary - Use secondary nodes for read operations
Ensure your MongoDB connection string includes authentication credentials in production environments.

Network Configuration

HTTP_PROXY
string
default:"null"
HTTP Proxy URL for outbound requests.Nullable: YesExample: http://proxy.example.com:8080

Monitoring and Observability

ENABLE_METRICS
boolean
default:"true (prod) / false (dev)"
Enable metrics reporting.Default: Automatically enabled in production mode
TRACING_HEADER
string
default:"x-cdp-request-id"
CDP tracing header name for request tracking.

Authentication Configuration

DEFRA_ID_DISCOVERY_URL
string
URI for fetching the OpenID Connect metadata document.Used for the signup/signin policy configuration.
DEFRA_ID_ISSUER
string
default:"http://localhost:3200/cdp-defra-id-stub"
The expected issuer for JWT validation.Must match the issuer claim in access tokens.

FSS API Configuration

The Financial Shared Services (FSS) API is used to manage bank details.
FSS_API_URL
string
default:"http://localhost:3003/api"
FSS API base URL for bank details operations.
FSS_API_KEY
string
default:"some-api-key"
API key to authenticate with the FSS API.
This should be a secure value in production environments.
FSS_API_ENCRYPTION_KEY
string
default:""
Base64-encoded encryption key for FSS bank details.
Required for encrypting/decrypting sensitive bank information. Must be properly configured in production.

Business Configuration

SINGLE_PAYMENT_DOC_WARNING_YEAR
string
default:"2025 to 2026"
Fiscal year range displayed to the frontend.Format: YYYY to YYYY

Authorization Configuration

Role-based access control for various operations. Each variable accepts an array of role codes.
VIEW_FULL_BANK_DETAILS
array
default:"[\"CEO\"]"
Permission roles allowed to view full bank details.Format: JSON array of role codesExample: ["CEO", "CFO"]
CONFIRM_BANK_DETAILS
array
default:"[\"CEO\", \"WO\"]"
Permission roles allowed to confirm bank details.Format: JSON array of role codes
CREATE_BANK_DETAILS
array
default:"[\"CEO\"]"
Permission roles allowed to create bank details.Format: JSON array of role codes
LIST_FINANCE_DOCUMENTS
array
default:"[\"CEO\"]"
Permission roles allowed to list finance documents.Format: JSON array of role codes
ACCESS_FINANCE_DOCUMENT
array
default:"[\"CEO\"]"
Permission roles allowed to access finance documents.Format: JSON array of role codes

Environment Variable Examples

export NODE_ENV=development
export PORT=3001
export HOST=0.0.0.0
export LOG_LEVEL=debug
export LOG_FORMAT=pino-pretty
export MONGO_URI=mongodb://localhost:27017/
export MONGO_DATABASE=epr-laps-backend
export DEFRA_ID_DISCOVERY_URL=http://localhost:3200/cdp-defra-id-stub/.well-known/openid-configuration
export DEFRA_ID_ISSUER=http://localhost:3200/cdp-defra-id-stub
export FSS_API_URL=http://localhost:3003/api
export FSS_API_KEY=dev-api-key
All configuration is validated on application startup using Convict. Invalid values will cause the application to fail to start with a validation error.

Next Steps

Build docs developers (and LLMs) love