Environment Variables
The API service can be configured using the following environment variables:
| Variable | Default | Description |
|---|---|---|
PORT | 3000 | HTTP server port |
HOST | :: | Host to bind to (supports IPv6) |
LOG_LEVEL | info | Logging level (debug, info, warn, error) |
REQUEST_TIMEOUT_MS | 8000 | Timeout for certificate fetch requests |
RATE_LIMIT_WINDOW_MS | 60000 | Rate limit window in milliseconds |
RATE_LIMIT_MAX | 30 | Maximum requests per rate limit window |
MAX_BODY_BYTES | 4096 | Maximum request body size |
REVOCATION_MODE | ocsp | Revocation check mode: ocsp, crl, or off |
CACHE_TTL_MS | 1800000 | Cache TTL in milliseconds (default: 30 minutes) |
APP_VERSION | dev | Application version string |
METRICS_ENABLED | false | Enable Prometheus metrics endpoint at /metrics |
Running from Source
Section titled “Running from Source”Development Mode
Section titled “Development Mode”npm run start:api:tsProduction Build
Section titled “Production Build”npm run build:apinpm run start:apiConfiguration Example
Section titled “Configuration Example”# Set custom port and enable verbose loggingexport PORT=8080export LOG_LEVEL=debug
# Configure caching (10 minutes)export CACHE_TTL_MS=600000
# Disable revocation checksexport REVOCATION_MODE=off
# Run the APInpm run start:apiAPI Configuration Endpoint
Section titled “API Configuration Endpoint”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.