Lighthouse API Reference
API Documentation
The full API reference is generated automatically from the source code during the build process.
When you run pnpm docs:build, TypeDoc generates detailed documentation for all exported types, interfaces, classes, and functions.
Main Exports
defineLighthouseConfig
Helper function for creating a type-safe configuration.
import { defineLighthouseConfig } from '@serverless-monolith/lighthouse';
export default defineLighthouseConfig({
proxy: { port: 5454 },
brunoPath: './bruno',
coreGroups: [...],
processes: [...],
});
Config Helpers
import {
defineLighthouseConfig,
getProcessConfig,
getAutoStartProcesses,
} from '@serverless-monolith/lighthouse';
Config Loader
import {
loadConfig,
hasConfigFile,
getConfigFilePath,
} from '@serverless-monolith/lighthouse';
Types
LighthouseConfig
Main configuration type.
interface LighthouseConfig {
proxy: ProxyConfig;
coreGroups: CoreGroup[];
processes: ProcessConfig[];
brunoPath: string;
ui?: UIOptions;
}
ProxyConfig
Proxy server configuration.
interface ProxyConfig {
port: number;
cors?: boolean;
logRequests?: boolean;
defaultTimeout?: number;
prefix?: string;
sqs?: SQSProxyOptions;
}
CoreGroup
Core group configuration.
interface CoreGroup {
coreName: string;
baseUrl: string;
routes: RouteConfig[];
}
RouteConfig
Route configuration within a core group.
interface RouteConfig {
name: string;
aliases?: string[];
pathPrefix?: string;
timeout?: number;
headers?: Record<string, string>;
routeByPath?: Record<string, RouteTarget>;
}
RouteTarget
Route target configuration.
interface RouteTarget {
url?: string;
pathPrefix?: string;
timeout?: number;
headers?: Record<string, string>;
weight?: number;
preserveMatchedPath?: boolean;
fallbackUrls?: string[];
transformPath?: (path: string) => string;
}
ProcessConfig
Process configuration (all fields except optional ones are required).
interface ProcessConfig {
id: string; // Required
name: string; // Required
description?: string;
command: string; // Required
args: string[]; // Required
cwd: string; // Required
mode: ProcessMode; // Required
autoStart?: boolean;
healthCheck: HealthCheckConfig; // Required
env?: Record<string, string>;
}
ProcessMode
Process operation mode.
type ProcessMode = 'managed' | 'external' | 'auto';
ProcessStatus
Process runtime status.
type ProcessStatus = 'stopped' | 'starting' | 'running' | 'error' | 'external';
HealthCheckConfig
Health check configuration (required for all processes).
interface HealthCheckConfig {
url: string; // Required
interval: number; // Required
timeout?: number; // Default: 5000
}
UIOptions
UI configuration options.
interface UIOptions {
defaultLayout?: 'split' | 'fullscreen';
theme?: 'default' | 'minimal';
}
SQSProxyOptions
SQS proxy options.
interface SQSProxyOptions {
enabled?: boolean;
refreshInterval?: number;
enableManagementRoutes?: boolean;
routePrefix?: string;
discoveryTimeout?: number;
}
LoadBalanceStrategy
Load balancing strategy.
type LoadBalanceStrategy = 'round-robin' | 'failover' | 'random';
Type Exports
import type {
LighthouseConfig,
ProxyConfig,
CoreGroup,
RouteConfig,
RouteTarget,
ProcessConfig,
ProcessMode,
ProcessStatus,
HealthCheckConfig,
UIOptions,
SQSProxyOptions,
LoadBalanceStrategy,
LogEntry,
} from '@serverless-monolith/lighthouse';
Parser Types
For advanced usage with Bruno collections:
import type {
ParsedBrunoStructure,
BrunoCollection,
BrunoCore,
BrunoRequestGroup,
BrunoRequest,
} from '@serverless-monolith/lighthouse';