diff --git a/packages/backend/README.md b/packages/backend/README.md index 48dd7f09fe..e9bf4199ff 100644 --- a/packages/backend/README.md +++ b/packages/backend/README.md @@ -39,19 +39,14 @@ If you want to use the catalog functionality, you need to add so called location to the backend. These are places where the backend can find some entity descriptor data to consume and serve. -To get started, you can issue the following after starting the backend: +To get started, you can issue the following after starting the backend, from inside +the `packages/catalog-backend` directory: ```bash -curl -i \ - -H "Content-Type: application/json" \ - -d '{"type":"github","target":"https://github.com/spotify/backstage/blob/master/plugins/catalog-backend/fixtures/two_components.yaml"}' \ - localhost:7000/catalog/locations +yarn mock-catalog-data ``` -After a short while, you should start seeing data on `localhost:7000/catalog/entities`. - -If you changed the `type` to `file` in the command above, and set the `target` -to the absolute path of a YAML file on disk, you could consume your own experimental data. +You should then start seeing data on `localhost:7000/catalog/entities`. The catalog currently runs in-memory only, so feel free to try it out, but it will need to be re-populated on next startup. diff --git a/plugins/catalog-backend/README.md b/plugins/catalog-backend/README.md index 051bc50417..8009fa89c0 100644 --- a/plugins/catalog-backend/README.md +++ b/plugins/catalog-backend/README.md @@ -7,6 +7,11 @@ This is the backend part of the default catalog plugin. It responds to requests from the frontend part, and fulfills them by delegating to your existing catalog related services. +## Getting Started + +After starting the backend, you can issue the `yarn mock-catalog-data` command +in this directory to populate the catalog with some mock entities. + ## Links - (Frontend part of the plugin)[https://github.com/spotify/backstage/tree/master/plugins/catalog] diff --git a/plugins/catalog-backend/fixtures/example-components.yaml b/plugins/catalog-backend/examples/example-components.yaml similarity index 100% rename from plugins/catalog-backend/fixtures/example-components.yaml rename to plugins/catalog-backend/examples/example-components.yaml diff --git a/plugins/catalog-backend/package.json b/plugins/catalog-backend/package.json index 761c042723..1aeea2538f 100644 --- a/plugins/catalog-backend/package.json +++ b/plugins/catalog-backend/package.json @@ -13,7 +13,7 @@ "prepack": "backstage-cli prepack", "postpack": "backstage-cli postpack", "clean": "backstage-cli clean", - "mock-data": "./scripts/mock-data" + "mock-catalog-data": "./scripts/mock-data" }, "dependencies": { "@backstage/backend-common": "^0.1.1-alpha.7", diff --git a/plugins/catalog-backend/scripts/mock-data b/plugins/catalog-backend/scripts/mock-data index 2342f09fa4..c9e4e35d7b 100755 --- a/plugins/catalog-backend/scripts/mock-data +++ b/plugins/catalog-backend/scripts/mock-data @@ -5,5 +5,5 @@ curl \ --header 'Content-Type: application/json' \ --data-raw '{ "type": "github", - "target": "https://github.com/spotify/backstage/blob/master/plugins/catalog-backend/fixtures/two_components.yaml" + "target": "https://github.com/spotify/backstage/blob/master/plugins/catalog-backend/examples/example-components.yaml" }'