@brickkit/cli/production-dashboard
Serve the production dashboard with bearer authentication and database access controls.
@brickkit/cli/production-dashboard exports 2 names: 1 function, 1 interface.
import { startProductionDashboard } from "@brickkit/cli/production-dashboard";Functions
| Function | Description |
|---|---|
startProductionDashboard | Serve the monitoring dashboard an app asks for with brick(\{ dashboard \}), in the process that serves the app. |
startProductionDashboard
function startProductionDashboard(
app: BrickApp,
options: { /** The port the app listens on, for the health probe. */ appPort: number; /** Where `.brick/` history is kept; the working folder by default. */ di…,
): Promise<ProductionDashboard | undefined>Serve the monitoring dashboard an app asks for with brick({ dashboard }),
in the process that serves the app. It listens on a port of its own, so it
stays up when the app's routes do not answer, and its /_health tells an
uptime monitor whether the app does. From here on ctx.logger and console
lines written during a request go to the dashboard, not the console.
Call it before the app starts listening. Returns undefined when the app asks for no dashboard, or when it cannot start (the app runs on without it, and says so). A configuration that would leave the dashboard open to others throws instead: the app must not start unprotected.
Parameters
| Name | Type | Description |
|---|---|---|
app | BrickApp | |
options | { /** The port the app listens on, for the health probe. */ appPort: number; /** Where ```.brick/` history is kept; the working folder by default. / directory?: string; warn?: (message: string) => void; /* * The project…`` |
Returns Promise<ProductionDashboard \| undefined>
Source: packages/cli/src/production-dashboard.ts:24
Interfaces
ProductionDashboard
interface ProductionDashboardProperties
| Name | Type | Description |
|---|---|---|
readonly host | string | |
readonly port | number |
Methods
| Name | Type | Description |
|---|---|---|
stop | stop(): void |