()
| 31 | } |
| 32 | |
| 33 | get url(): string { |
| 34 | invariant( |
| 35 | this._url, |
| 36 | 'Failed to get "url" on WebSocketServer: server is not running. Did you forget to "await server.listen()"?', |
| 37 | ) |
| 38 | return this._url |
| 39 | } |
| 40 | |
| 41 | public async listen(port = 0): Promise<void> { |
| 42 | const address = await this.app.listen({ |