* Configure the `basePath` for the rest server * @param path - Base path
(path = '')
| 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. |
no outgoing calls
no test coverage detected