Added support for new backend system

Signed-off-by: Josh Uvi <joshuauvbiekpahor@gmail.com>
This commit is contained in:
Josh Uvi
2023-10-20 12:22:09 +01:00
parent ec779d4d8c
commit 11f671eaa9
5 changed files with 94 additions and 0 deletions
+23
View File
@@ -67,6 +67,29 @@ diff --git a/packages/backend/src/index.ts b/packages/backend/src/index.ts
apiRouter.use(notFoundHandler());
```
## New Backend System
The code coverage 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';
+ import { codeCoveragePlugin } from '@backstage/plugin-code-coverage-backend';
const backend = createBackend();
// ... other feature additions
+ backend.add(codeCoveragePlugin());
backend.start();
```
Alternatively, you can actually remove the import line above, and do this instead.
```diff
backend.add(explorePlugin());
+ backend.add(import('@backstage/plugin-explore-backend'));
```
## Configuring your entity
In order to use this plugin, you must set the `backstage.io/code-coverage` annotation.