Skip to content

Commit

Permalink
fix: build error with new plugin.ts file
Browse files Browse the repository at this point in the history
Signed-off-by: Josh Uvi <[email protected]>
  • Loading branch information
Josh-Uvi committed Oct 16, 2023
1 parent dc3bb4f commit 6037b4d
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions plugins/qeta-backend/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,6 @@ import { getRootLogger } from '@backstage/backend-common';

const logger = getRootLogger();

const configs = await loadBackendConfig({ logger, argv: process.argv });

const database = useHotMemoize(module, () => {
return Knex(configs.get('backend.database'));
});

const db = await DatabaseQetaStore.create({
database: { getClient: async () => database },
});

export const qetaPlugin = createBackendPlugin({
pluginId: 'qeta',
register(env) {
Expand All @@ -36,12 +26,22 @@ export const qetaPlugin = createBackendPlugin({
identity: coreServices.identity,
},
async init({ config, httpRouter, identity }) {
const configs = await loadBackendConfig({ logger, argv: process.argv });

const getDatabase = useHotMemoize(module, () => {
return Knex(configs.get('backend.database'));
});

const database = await DatabaseQetaStore.create({
database: { getClient: async () => getDatabase },
});

httpRouter.use(
await createRouter({
config,
logger,
identity,
database: db,
database,
}),
);
},
Expand Down

0 comments on commit 6037b4d

Please sign in to comment.