UrlProvider

Skull. UrlProvider

new UrlProvider()

A tool to combine domains, ports, protocols, API endpoints with versions ans subtypes into URL.

Any URL consists of following parts: protocol://domain/prefix/ None of this parts are required, but you should understand that setting protocol without domain will result in relative URL from current domain root: /restEndpoint/.

Note that skipping protocol and adding domain will lead to inheriting protocol from current document: //my.api.example.com/restEndpoint/, and this is completely valid URL.

Source:

Methods

getApiPath() → {String}

Returns relative URL from root of domain.

Source:
Returns:
Type
String

getApiUrl() → {String}

Get absolute URL, with domain and protocol if provided.

Source:
Returns:
Type
String

set(options)

Updates inner state of URL pieces

Parameters:
Name Type Description
options Object
Source: