(host, pathname = "", isRaw = true)
| 783 | } |
| 784 | |
| 785 | getServerUrlRaw(host, pathname = "", isRaw = true) { |
| 786 | if(!this._server || !this._serverProtocol) { |
| 787 | throw new Error("Access to server url not yet available."); |
| 788 | } |
| 789 | |
| 790 | let address = this._server.address(); |
| 791 | if(!address?.port) { |
| 792 | throw new Error("Access to server port not yet available."); |
| 793 | } |
| 794 | |
| 795 | return `${this._serverProtocol}//${host}:${address.port}${isRaw ? pathname : this.getServerPath(pathname)}`; |
| 796 | } |
| 797 | |
| 798 | getServerUrl(host, pathname = "") { |
| 799 | return this.getServerUrlRaw(host, pathname, false); |
no test coverage detected