message: Use discovery api to build URLs in techdocs
  Use the discovery api to build catalog API URLs and URLs to locally published
  metadata.
diff: @@ -62,7 +62,13 @@ export async function createRouter({
  const router = Router();
  router.get('/metadata/mkdocs/*', async (req, res) => {
  - const storageUrl = config.getString('techdocs.storageUrl');
  + let storageUrl = config.getString('techdocs.storageUrl');
  + if (publisher instanceof LocalPublish) {
  + storageUrl = new URL(
  + new URL(storageUrl).pathname,
  + await discovery.getBaseUrl('techdocs'),
  + ).toString();
  + }
  const { '0': path } = req.params;
  const metadataURL = `${storageUrl}/${path}/techdocs_metadata.json`;
  @@ -77,13 +83,14 @@ export async function createRouter({
  });
  router.get('/metadata/entity/:namespace/:kind/:name', async (req, res) => {
  - const baseUrl = config.getString('backend.baseUrl');
  + const catalogUrl = await discovery.getBaseUrl('catalog');
  +
  const { kind, namespace, name } = req.params;
  try {
  const entity = (await (
  await fetch(
  - `${baseUrl}/api/catalog/entities/by-name/${kind}/${namespace}/${name}`,
  + `${catalogUrl}/entities/by-name/${kind}/${namespace}/${name}`,
  )
  ).json()) as Entity;
  