Skip to content

Environment Variables

The API service can be configured using the following environment variables:

VariableDefaultDescription
PORT3000HTTP server port
HOST::Host to bind to (supports IPv6)
LOG_LEVELinfoLogging level (debug, info, warn, error)
REQUEST_TIMEOUT_MS8000Timeout for certificate fetch requests
RATE_LIMIT_WINDOW_MS60000Rate limit window in milliseconds
RATE_LIMIT_MAX30Maximum requests per rate limit window
MAX_BODY_BYTES4096Maximum request body size
REVOCATION_MODEocspRevocation check mode: ocsp, crl, or off
CACHE_TTL_MS1800000Cache TTL in milliseconds (default: 30 minutes)
APP_VERSIONdevApplication version string
METRICS_ENABLEDfalseEnable Prometheus metrics endpoint at /metrics
Terminal window
npm run start:api:ts
Terminal window
npm run build:api
npm run start:api
Terminal window
# Set custom port and enable verbose logging
export PORT=8080
export LOG_LEVEL=debug
# Configure caching (10 minutes)
export CACHE_TTL_MS=600000
# Disable revocation checks
export REVOCATION_MODE=off
# Run the API
npm run start:api

The API exposes a public configuration endpoint at GET /api/config that returns:

{
"cacheTtlMs": 1800000,
"revocationMode": "ocsp"
}

This endpoint is used by the extension to fetch cache settings and revocation mode.

See Metrics Configuration