Updated README.md example

Signed-off-by: Andre Wanlin <67169551+awanlin@users.noreply.github.com>
This commit is contained in:
Andre Wanlin
2022-12-30 15:01:50 -06:00
parent c5021564c6
commit 9f9d279bd1
3 changed files with 12 additions and 5 deletions
+6
View File
@@ -0,0 +1,6 @@
---
'@backstage/plugin-explore-backend': patch
'@backstage/plugin-explore': patch
---
Updated `README.md` examples
+5 -5
View File
@@ -11,32 +11,32 @@ for these tools.
```bash
# From your Backstage root directory
yarn add --cwd packages/backend @backstage/plugin-explore-backend
yarn add --cwd packages/backend @backstage/plugin-explore-backend @backstage/plugin-explore-common
```
### Adding the plugin to your `packages/backend`
You'll need to add the plugin to the router in your `backend` package. You can
do this by creating a file called `packages/backend/src/plugins/explore.ts`
do this by creating a file called `packages/backend/src/plugins/explore.ts` with the following content:
```ts
import {
createRouter,
StaticExploreToolProvider,
} from '@backstage/plugin-explore-backend';
import { ExploreTool } from '@backstage/plugin-explore-common';
import { Router } from 'express';
import { PluginEnvironment } from '../types';
// List of tools you want to surface in the Explore plugin "Tools" page.
const tools: ExploreTool[] = [
const exploreTools: ExploreTool[] = [
{
title: 'New Relic',
description:'new relic plugin',
description: 'new relic plugin',
url: '/newrelic',
image: 'https://i.imgur.com/L37ikrX.jpg',
tags: ['newrelic', 'proxy', 'nerdGraph'],
},
...
];
export default async function createPlugin(
+1
View File
@@ -68,6 +68,7 @@ ready to make modifications, add the following code snippet to add the
```diff
+import { ToolSearchResultListItem } from '@backstage/plugin-explore';
+import BuildIcon from '@material-ui/icons/Build';
const SearchPage = () => {
...