Skip to content

ui-router-server / prerender / withBase

Function: withBase() ​

ts
function withBase(base, path): string;

Defined in: base-path.ts:37

A host-absolute path as a host serving the site under base spells it: withBase('/solar/', '/contacts') is /solar/contacts.

base is a path base, with or without its trailing slash. Under / the path stays as written, as does anything that is not a host-absolute path: a full url (https://example.test/x), a protocol-relative one (//example.test/x) and a relative path (x, ./x, ?q=1). The path is never inspected for the base, so one that already carries it gets it twice.

Parameters ​

ParameterType
basestring
pathstring

Returns ​

string