MCPcopy Create free account
hub / github.com/11ty/dev-server / getServerUrlRaw

Method getServerUrlRaw

server.js:785–796  ·  view source on GitHub ↗
(host, pathname = "", isRaw = true)

Source from the content-addressed store, hash-verified

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);

Callers 2

getServerUrlMethod · 0.95

Calls 1

getServerPathMethod · 0.95

Tested by

no test coverage detected