backstage: Techdocs can't query catalog metadata when using app-backend

image

When using app-backend where frontend and backend are running off the same URL, Techdocs is not able to retrieve metadata and fails.

Expected Behavior

Should be able to use Techdocs in app-backend.

Current Behavior

For some reason, fetch to ${catalogUrl}/entities/by-name/${kind}/${namespace}/${name} returns content of index.html instead of metadata. I can use the generated URL to retrieve the metadata by calling the API directly via the browser.

Possible Solution

🤷‍♀️

Steps to Reproduce

  1. Using release 0.2.0
app:
  baseUrl: http://localhost:7000

backend:
  baseUrl: http://localhost:7000
  listen:
    port: 7000
  csp:
    connect-src: ["'self'", 'http:', 'https:']

techdocs:
  storageUrl: http://localhost:7000/api/techdocs/static/docs
  requestUrl: http://localhost:7000/api/techdocs
  1. Use the config above on the example app and backend
  2. Try to generate documentation
  3. You should get a similar error as above

Context

Trying to get a basic documentation site working for demo purposes.

Your Environment

  • NodeJS Version (v12): 12
  • Operating System and Version (e.g. Ubuntu 14.04): Mac OS X
  • Browser Information: Chrome

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 19 (17 by maintainers)

Most upvoted comments

@taras i actually merged support for that just today 😃 https://github.com/backstage/backstage/pull/3437

Does the following in the app-config.yaml fix things?

backend:
  csp:
    upgrade-insecure-requests: false

You may want to place this in an app-config.local.yaml that gets picked up automatically during local dev.