update installation instructions in readme files for new backend system

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2024-09-04 11:15:41 +02:00
parent 906dfe9873
commit 5d1670f959
9 changed files with 79 additions and 232 deletions
+24 -19
View File
@@ -4,7 +4,30 @@ Welcome to the DevTools backend plugin! This plugin provides data for the [DevTo
## Setup
Here's how to get the DevTools Backend up and running:
Here's how to get the DevTools Backend up and running in the new backend system:
1. First we need to add the `@backstage/plugin-devtools-backend` package to your backend:
```sh
# From the Backstage root directory
yarn --cwd packages/backend add @backstage/plugin-devtools-backend
```
2. Then add the plugin to your backend index file:
```ts
// In packages/backend/src/index.ts
const backend = createBackend();
// ... other feature additions
backend.add(import('@backstage/plugin-devtools-backend'));
```
3. Now run `yarn start-backend` from the repo root
4. Finally open `http://localhost:7007/api/devtools/health` in a browser and it should return `{"status":"ok"}`
## Old Backend System
If you are still on the old backend system, please consider migrating to the new backend system. But to install this plugin in an old backend, see below.
1. First we need to add the `@backstage/plugin-devtools-backend` package to your backend:
@@ -50,24 +73,6 @@ Here's how to get the DevTools Backend up and running:
4. Now run `yarn start-backend` from the repo root
5. Finally open `http://localhost:7007/api/devtools/health` in a browser and it should return `{"status":"ok"}`
### New Backend System
The DevTools backend plugin has support for the [new backend system](https://backstage.io/docs/backend-system/), here's how you can set that up:
In your `packages/backend/src/index.ts` make the following changes:
```diff
import { createBackend } from '@backstage/backend-defaults';
const backend = createBackend();
// ... other feature additions
+ backend.add(import('@backstage/plugin-devtools-backend'));
backend.start();
```
## Links
- [Frontend part of the plugin](https://github.com/backstage/backstage/tree/master/plugins/devtools)