Skip to content

five-on-it / apps/server/src/http / GameHttpOptions

Interface: GameHttpOptions ​

Defined in: apps/server/src/http.ts:86

What the endpoints need.

Properties ​

admission? ​

optional admission?: () => Admission

Defined in: apps/server/src/http.ts:98

Whether the server takes a new room or player now (capacity.ts); always without.

Returns ​

Admission


debugRuns? ​

optional debugRuns?: DebugRuns

Defined in: apps/server/src/http.ts:116

Runs without the platform for a server whose debug commands are on (debug-runs.ts: ?run=).


drain? ​

optional drain?: (seconds?) => void

Defined in: apps/server/src/http.ts:102

Starts draining for maintenance (POST /drain with the room secret; ?seconds= before the rooms close).

Parameters ​

seconds? ​

number

Returns ​

void


fetchArtifact? ​

optional fetchArtifact?: (url) => Promise<unknown>

Defined in: apps/server/src/http.ts:104

Fetches an artifact (the API's URL); fetch by default.

Parameters ​

url ​

string

Returns ​

Promise<unknown>


fetchImpl? ​

optional fetchImpl?: {(input, init?): Promise<Response>; (input, init?): Promise<Response>; }

Defined in: apps/server/src/http.ts:106

The HTTP client a public room's chat is moderated with; fetch by default.

Call Signature ​

(input, init?): Promise<Response>

MDN Reference

Parameters ​
input ​

URL | RequestInfo

init? ​

RequestInit

Returns ​

Promise<Response>

Call Signature ​

(input, init?): Promise<Response>

MDN Reference

Parameters ​
input ​

string | URL | Request

init? ​

RequestInit

Returns ​

Promise<Response>


host ​

host: RoomHost

Defined in: apps/server/src/http.ts:88

The rooms.


join? ​

optional join?: "open" | "token"

Defined in: apps/server/src/http.ts:92

Whether the default room and the levels' rooms ask for a join token too (token), or take anyone (open, the default).


levelRoom? ​

optional levelRoom?: (name, admission) => LevelRoomAnswer | Promise<LevelRoomAnswer>

Defined in: apps/server/src/http.ts:108

The room that plays a level a connection asks for (?level=), opening it if need be and the admission allows (level-rooms.ts); without it, no level is asked for.

Parameters ​

name ​

string

admission ​

Admission

Returns ​

LevelRoomAnswer | Promise<LevelRoomAnswer>


log? ​

optional log?: (message) => void

Defined in: apps/server/src/http.ts:112

Where to log.

Parameters ​

message ​

string

Returns ​

void


loopStats ​

loopStats: () => Record<string, number>

Defined in: apps/server/src/http.ts:94

The loop's numbers for the health report.

Returns ​

Record<string, number>


metrics? ​

optional metrics?: ServerMetrics

Defined in: apps/server/src/http.ts:96

The process's Prometheus metrics, served at /metrics.


rtc? ​

optional rtc?: RtcPeerHost & object

Defined in: apps/server/src/http.ts:114

The WebRTC data channel's host (rtc-host.ts), when the server offers the channel (FOI_RTC=1).

Type Declaration ​

stats() ​

stats(): RtcStats

Returns ​

RtcStats


runAdmission? ​

optional runAdmission?: () => RunAdmission

Defined in: apps/server/src/http.ts:100

Whether the server takes another run now, beside its admission (capacity.ts: its cap of runs); always without.

Returns ​

RunAdmission


secret ​

secret: string | undefined

Defined in: apps/server/src/http.ts:90

The room secret: rooms can be opened and joined only with it.