Created
March 8, 2022 00:28
-
-
Save larkintuckerllc/328bfcc13f33fe6ee55f824c5e35cbb7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
createApiFactory, | |
createPlugin, | |
createRoutableExtension, | |
discoveryApiRef, | |
} from '@backstage/core-plugin-api'; | |
import { MyPluginBackendClient } from './api/MyPluginBackendClient'; | |
import { myPluginApiRef } from './api/types'; | |
import { rootCatalogMyPluginRouteRef } from './routes'; | |
export const myPluginPlugin = createPlugin({ | |
id: 'my-plugin', | |
apis: [ | |
createApiFactory({ | |
api: myPluginApiRef, | |
deps: { | |
discoveryApi: discoveryApiRef, | |
}, | |
factory: ({ discoveryApi }) => | |
new MyPluginBackendClient({ discoveryApi }), | |
}), | |
], | |
routes: { | |
root: rootCatalogMyPluginRouteRef, | |
}, | |
}); | |
export const EntityMyPluginContent = myPluginPlugin.provide( | |
createRoutableExtension({ | |
name: 'EntityMyPluginContent', | |
component: () => | |
import('./components/ExampleComponent').then(m => m.ExampleComponent), | |
mountPoint: rootCatalogMyPluginRouteRef, | |
}), | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment