fixed plugin export and README

Signed-off-by: Deepankumar Loganathan <deepan0433@gmail.com>
This commit is contained in:
Deepankumar Loganathan
2024-02-20 15:03:33 +01:00
parent 85db926bb6
commit 0cd6d20f71
3 changed files with 7 additions and 4 deletions
+4 -2
View File
@@ -51,14 +51,17 @@ Here's how to get the backend plugin up and running:
} from '@backstage/plugin-azure-sites-backend';
import { Router } from 'express';
import { PluginEnvironment } from '../types';
import { CatalogClient } from '@backstage/catalog-client'
export default async function createPlugin(
env: PluginEnvironment,
): Promise<Router> {
return await createRouter({
const catalogApi = new CatalogClient({ discoveryApi: env.discovery })
logger: env.logger,
azureSitesApi: AzureSitesApi.fromConfig(env.config),
permissions: env.permissions,
catalogApi
});
}
```
@@ -115,13 +118,12 @@ In your `packages/backend/src/index.ts` make the following changes:
```diff
import { createBackend } from '@backstage/backend-defaults';
+ import { azureSitesPlugin } from '@backstage/plugin-azure-sites-backend;
const backend = createBackend();
// ... other feature additions
+ backend.add(azureSitesPlugin);
+ backend.add(import('@backstage/plugin-azure-sites-backend'));
// ...
+2 -1
View File
@@ -52,7 +52,8 @@ export class AzureSitesConfig {
}
// @public
export const azureSitesPlugin: () => BackendFeature;
const azureSitesPlugin: () => BackendFeature;
export default azureSitesPlugin;
// @public (undocumented)
export function createRouter(options: RouterOptions): Promise<express.Router>;
+1 -1
View File
@@ -17,4 +17,4 @@
export * from './service/router';
export * from './api';
export * from './config';
export { azureSitesPlugin } from './plugin';
export { azureSitesPlugin as default } from './plugin';