MCPcopy Create free account
hub / github.com/loopbackio/loopback-next / basePath

Method basePath

packages/rest/src/rest.server.ts:959–970  ·  view source on GitHub ↗

* Configure the `basePath` for the rest server * @param path - Base path

(path = '')

Source from the content-addressed store, hash-verified

957 * @param path - Base path
958 */
959 basePath(path = '') {
960 if (this._requestHandler != null) {
961 throw new Error(
962 'Base path cannot be set as the request handler has been created',
963 );
964 }
965 // Trim leading and trailing `/`
966 path = path.replace(/(^\/)|(\/$)/, '');
967 if (path) path = '/' + path;
968 this._basePath = path;
969 this.config.basePath = path;
970 }
971
972 /**
973 * Start this REST API's HTTP/HTTPS server.

Calls

no outgoing calls

Tested by

no test coverage detected