move cost insights example client to plugin

This commit is contained in:
Ryan Vazquez
2020-10-26 15:00:46 -04:00
parent b173dacb46
commit 0eac8f037d
9 changed files with 35 additions and 37 deletions
+16 -3
View File
@@ -13,8 +13,21 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { createDevApp } from '@backstage/dev-utils';
import { plugin } from '../src/plugin';
import { createPlugin, createApiFactory } from '@backstage/core';
import { ExampleCostInsightsClient } from '../src/api';
import { costInsightsApiRef } from '../src';
import { pluginConfig } from '../src/plugin';
createDevApp().registerPlugin(plugin).render();
const devPlugin = createPlugin({
...pluginConfig,
apis: [
createApiFactory({
api: costInsightsApiRef,
deps: {},
factory: () => new ExampleCostInsightsClient()
})
]
});
createDevApp().registerPlugin(devPlugin).render();