HTTP server assembly. Wires the Express backend, request adapter, OpenAPI description and mDNS advertisement together into the closedcode server that the SDK and TUI connect to.

Methods

(static) Legacy(opts) → {Object}

Build an Express server, forcing the explicit "express" backend selection.

Parameters:
NameTypeDescription
optsObject

Server construction options forwarded to createExpress.

Returns:

The constructed server instance.

Type: 
Object

(static) listen(opts) → {Promise.<Object>}

Build and start the server, listening on the configured hostname/port, and optionally publishing an mDNS advertisement (skipped for loopback hosts). Sets the module-level url to the resolved listen address.

Parameters:
NameTypeDescription
optsObject

Listen options including hostname, port, mdns, and mdnsDomain.

Returns:

A handle { hostname, port, url, stop } where stop(close) shuts the server down (idempotent) and unpublishes mDNS.

Type: 
Promise.<Object>

(static) openapi() → {Object}

Return the OpenAPI description document for the Express backend.

Returns:

The OpenAPI specification object.

Type: 
Object

(inner) create(opts) → {Object}

Build a fresh Express server with the auto-selected backend and given options.

Parameters:
NameTypeDescription
optsObject

Server construction options forwarded to createExpress.

Returns:

The constructed server instance.

Type: 
Object

(inner) select() → {Object}

Determine which server backend to use.

Returns:

The backend selection descriptor.

Type: 
Object

(inner) withBackend(selection, built) → {*}

Log the chosen server backend selection and pass the built server through.

Parameters:
NameTypeDescription
selectionObject

Backend selection descriptor from ServerBackend.select.

built*

The constructed server instance to return unchanged.

Returns:

The same built value that was passed in.

Type: 
*