Skip to main content
Version: Next

DiscoveryService.getBaseUrl()

Home > @backstage/backend-plugin-api > DiscoveryService > getBaseUrl

Returns the internal HTTP base URL for a given plugin, without a trailing slash.

Signature:

getBaseUrl(pluginId: string): Promise<string>;

Parameters

Parameter

Type

Description

pluginId

string

**Returns:**

Promise<string>

Remarks

The returned URL should point to an internal endpoint for the plugin, with the shortest route possible. The URL should be used for service-to-service communication within a Backstage backend deployment.

This method must always be called just before making each request, as opposed to fetching the URL once when constructing an API client. That is to ensure that more flexible routing patterns can be supported where a different result might be returned each time.

For example, asking for the URL for catalog may return something like http://10.1.2.3/api/catalog