Cell API
    Preparing search index...

    Class CellDevServer

    cell dev on one port (docs/design/architecture.md §6): Vite serves the frontend with HMR, and the backend runs in the server environment's module runner. Its entry hands the request handler over through ApplicationHost instead of listening; when one of its files changes, the old application is stopped, the runner forgets every module and the entry is imported again.

    Index
    backendError?: any
    closed: boolean = false
    loading: Promise<void> = ...
    options: CellDevServerOptions = {}
    pending: Set<string> = ...
    plugin: CellPlugin
    timer?: Timeout
    vite: ViteDevServer
    CONFIG_FILE: RegExp = ...
    CONTENT_TYPES: Record<string, string> = ...
    DEFAULT_HOST: "127.0.0.1" = '127.0.0.1'
    DEFAULT_PORT: 3000
    • get configFiles(): string[]

      Files whose change makes a new project model: the component's cell*.yml and package.json, and the project's cell.config.*.

      Returns string[]

    • get handler(): (req: IncomingMessage, res: ServerResponse) => void

      Every request handler of the server in one: Vite, the frontend page, module handlers, the backend.

      Returns (req: IncomingMessage, res: ServerResponse) => void

    • get serverEnvironment(): DevEnvironment & {
          runner: { clearCache(): void; import(url: string): Promise<unknown> };
      }

      Returns DevEnvironment & {
          runner: { clearCache(): void; import(url: string): Promise<unknown> };
      }

    • Parameters

      • req: IncomingMessage
      • res: ServerResponse
      • next: (error?: unknown) => void

      Returns Promise<void>

    • Imports a module into the backend's module runner (with the generated container and configuration).

      Type Parameters

      • T = Record<string, unknown>

      Parameters

      • specifier: string

      Returns Promise<T>

    • Parameters

      • event: string
      • file: string

      Returns void

    • Parameters

      • req: IncomingMessage
      • res: ServerResponse

      Returns void

    • Stops the running backend and starts it again from fresh modules.

      Parameters

      • files: string[]

      Returns Promise<void>

    • Parameters

      • error: unknown
      • code: string

      Returns CellError