chore(plugins): Refactor the badge backend to store data in database instead of memory. Fix conversation as well

Signed-off-by: Rbillon59 <r.billon@celonis.com>
This commit is contained in:
Rbillon59
2023-04-07 16:06:09 +02:00
parent b34749a91e
commit 1aabf9e03f
17 changed files with 844 additions and 270 deletions
+6
View File
@@ -20,10 +20,15 @@ import {
} from '@backstage/plugin-badges-backend';
import { Router } from 'express';
import { PluginEnvironment } from '../types';
import { DatabaseBadgesStore } from '@backstage/plugin-badges-backend';
export default async function createPlugin(
env: PluginEnvironment,
): Promise<Router> {
const db = await DatabaseBadgesStore.create({
database: env.database,
});
return await createRouter({
config: env.config,
discovery: env.discovery,
@@ -31,5 +36,6 @@ export default async function createPlugin(
tokenManager: env.tokenManager,
logger: env.logger,
identity: env.identity,
db: db,
});
}