Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2021-09-10 10:39:24 +02:00
committed by Johan Haals
parent 37a218dc79
commit 559a0de98c
9 changed files with 117 additions and 56 deletions
+3 -19
View File
@@ -14,10 +14,7 @@
* limitations under the License.
*/
import {
CatalogBuilder,
createRouter,
} from '@backstage/plugin-catalog-backend';
import { CatalogBuilder } from '@backstage/plugin-catalog-backend';
import { Router } from 'express';
import { PluginEnvironment } from '../types';
@@ -25,20 +22,7 @@ export default async function createPlugin(
env: PluginEnvironment,
): Promise<Router> {
const builder = await CatalogBuilder.create(env);
const {
entitiesCatalog,
locationAnalyzer,
processingEngine,
locationService,
} = await builder.build();
const { processingEngine, router } = await builder.build();
await processingEngine.start();
return await createRouter({
entitiesCatalog,
locationAnalyzer,
locationService,
logger: env.logger,
config: env.config,
});
return router;
}