Skip to main content

createUrl

Builds a full API URL with optional query parameters.

Parameters

ParameterTypeDescription
pathstringThe API endpoint path (relative to base URL)
paramsobject (optional)Query parameters to append to the URL

Returns

URL

Example

const url = host.createUrl("vrm");
// http://localhost:3100/vrm

const url = host.createUrl("entities", { name: "MyCharacter", root: 42 });
// http://localhost:3100/entities?name=MyCharacter&root=42