cost-insights: refactor plugin creation to call createPlugin directly

Co-authored-by: blam <ben@blam.sh>
This commit is contained in:
Patrik Oldsberg
2020-12-02 18:31:59 +01:00
parent d7bb7bf39b
commit 21a3d3dcac
2 changed files with 12 additions and 19 deletions
+9 -14
View File
@@ -14,20 +14,15 @@
* limitations under the License.
*/
import { createDevApp } from '@backstage/dev-utils';
import { createPlugin, createApiFactory } from '@backstage/core';
import { costInsightsApiRef } from '../src/api';
import { ExampleCostInsightsClient } from '../src/client';
import { pluginConfig } from '../src/plugin';
import { plugin } from '../src/plugin';
const devPlugin = createPlugin({
...pluginConfig,
apis: [
createApiFactory({
api: costInsightsApiRef,
deps: {},
factory: () => new ExampleCostInsightsClient(),
}),
],
});
createDevApp().registerPlugin(devPlugin).render();
createDevApp()
.registerPlugin(plugin)
.registerApi({
api: costInsightsApiRef,
deps: {},
factory: () => new ExampleCostInsightsClient(),
})
.render();