Skip to content

ShoehiveServer

Defined in: server/server.ts:178

readonly optional devtools?: DevtoolsHandle

Defined in: server/server.ts:193

The devtools inspector, present only when devtools is enabled (ADR 0011).


readonly ready: Promise<void>

Defined in: server/server.ts:180

Resolves once stored tables are recovered (connections wait for it automatically).


readonly tables: object

Defined in: server/server.ts:194

close(id): Promise<void>

string

Promise<void>

create(game, options?): Promise<TableInfo>

string

string

unknown

Promise<TableInfo>

get(id): TableInfo | undefined

string

TableInfo | undefined

list(): TableInfo[]

TableInfo[]

reload(id): Promise<void>

Reloads a table from the store, for example after it faulted.

string

Promise<void>

runtime(id): TableRuntime | undefined

The table's runtime: server-side only, never exposed to clients.

string

TableRuntime | undefined

start(id): Promise<void>

string

Promise<void>

attach(server): Promise<void>

Defined in: server/server.ts:189

Adds the WebSocket endpoint to an existing HTTP server. With devtools enabled it also routes devtools paths ahead of the server's current request listeners (restored on close()); every other request reaches them unchanged. Upgrades to other paths follow unknownUpgrades.

Server

Promise<void>


close(options?): Promise<void>

Defined in: server/server.ts:214

Stops the server. Graceful by default: drains table queues, writes a snapshot of every table, then closes connections with code 1001. graceful: false drops everything immediately, like a crash (useful to test recovery).

boolean

Promise<void>


connect(request?): MemorySocket

Defined in: server/server.ts:191

Opens an in-memory connection (tests, same-process clients).

UpgradeRequest

MemorySocket


listen(options?): Promise<{ port: number; url: string; }>

Defined in: server/server.ts:182

Starts an HTTP server with the WebSocket endpoint. Upgrades to other paths get HTTP 404.

string

number

Promise<{ port: number; url: string; }>


on<E>(event, listener): () => void

Defined in: server/server.ts:205

E extends keyof ServerEvents

E

(payload) => void

() => void