five-on-it / apps/server/src/http / GameHttpOptions
Interface: GameHttpOptions
Defined in: apps/server/src/http.ts:86
What the endpoints need.
Properties
admission?
optionaladmission?: () =>Admission
Defined in: apps/server/src/http.ts:98
Whether the server takes a new room or player now (capacity.ts); always without.
Returns
debugRuns?
optionaldebugRuns?: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?
optionaldrain?: (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?
optionalfetchArtifact?: (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?
optionalfetchImpl?: {(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>
Parameters
input
URL | RequestInfo
init?
RequestInit
Returns
Promise<Response>
Call Signature
(
input,init?):Promise<Response>
Parameters
input
string | URL | Request
init?
RequestInit
Returns
Promise<Response>
host
host:
RoomHost
Defined in: apps/server/src/http.ts:88
The rooms.
join?
optionaljoin?:"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?
optionallevelRoom?: (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
Returns
LevelRoomAnswer | Promise<LevelRoomAnswer>
log?
optionallog?: (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?
optionalmetrics?:ServerMetrics
Defined in: apps/server/src/http.ts:96
The process's Prometheus metrics, served at /metrics.
rtc?
optionalrtc?: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
runAdmission?
optionalrunAdmission?: () =>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
secret
secret:
string|undefined
Defined in: apps/server/src/http.ts:90
The room secret: rooms can be opened and joined only with it.