Skip to main content

DiscoveryService.getBaseUrl()

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

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

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 a request, as opposed to fetching the URL when constructing an API client. That is to ensure that more flexible routing patterns can be supported.

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

Signature:

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

Parameters

ParameterTypeDescription
pluginIdstring

Returns:

Promise<string>