brick.ts

@brickkit/cli/production-dashboard

Serve the production dashboard with bearer authentication and database access controls.

llms.txt

@brickkit/cli/production-dashboard exports 2 names: 1 function, 1 interface.

import { startProductionDashboard } from "@brickkit/cli/production-dashboard";

Functions

FunctionDescription
startProductionDashboardServe 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

NameTypeDescription
appBrickApp
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 ProductionDashboard

Properties

NameTypeDescription
readonly hoststring
readonly portnumber

Methods

NameTypeDescription
stopstop(): void

Source: packages/cli/src/production-dashboard.ts:6

On this page

Generated from the JSDoc above each export. Edit the comment there.