Overview
Learn the key components to setting up Panel.
Setting up Panel
Create a Panel by calling createPanel() and passing a configuration object.
import { createPanel } from "@slot-engine/panel"
import { game as MyGame } from "../../path-to/my-game"
const panel = createPanel({
games: [MyGame],
})
panel.start()createPanel() Options
| Property | Type | Description | Required |
|---|---|---|---|
games | SlotGame[] | A list of connected games. | yes |
lgs | EngineLgs | A local gaming server, served on the panel port. See Attach an LGS. |
Attach an LGS
Pass an LGS from @slot-engine/lgs to serve it on the panel port next to the panel.
The panel registers its games with the LGS and announces it at startup.
import { EngineLgs, InMemoryStorage } from "@slot-engine/lgs"
import { createPanel } from "@slot-engine/panel"
import { game as MyGame } from "../../path-to/my-game"
const panel = createPanel({
games: [MyGame],
lgs: new EngineLgs({ storage: new InMemoryStorage() }),
})
panel.start()⚡️ Slot Engine Panel is running on http://localhost:7770
:: 1 games loaded
:: LGS "Engine" attached, rgs_url=localhost:7770Do not set port on an LGS that you pass to the panel. createPanel() throws when the LGS has one.
Sessions are created through POST http://localhost:7770/lgs/sessions, see Sessions.
Use of AI on this page: Some texts were improved with or written by AI.