fixed plugin export and README
Signed-off-by: Deepankumar Loganathan <deepan0433@gmail.com>
This commit is contained in:
@@ -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
@@ -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>;
|
||||
|
||||
@@ -17,4 +17,4 @@
|
||||
export * from './service/router';
|
||||
export * from './api';
|
||||
export * from './config';
|
||||
export { azureSitesPlugin } from './plugin';
|
||||
export { azureSitesPlugin as default } from './plugin';
|
||||
|
||||
Reference in New Issue
Block a user