Files
jlinc-server/backend/apps.js
2026-08-20 15:08:32 +00:00

25 lines
723 B
JavaScript

import { getConfig } from "./common/config.js";
import { watchAudits } from "./common/queue.js";
import { getPool } from "./db/index.js";
export async function loadApps() {
const config = getConfig();
const client = await getPool();
for (const type in config.appModules) {
// Internal modules (e.g. dashboard) have no `app` row / API surface.
if (config.appModules[type]?.internal) continue;
await client.query(`
INSERT INTO public.app (
type
) VALUES (
$1
) ON CONFLICT DO NOTHING;
`, [
type,
]);
if (type === 'core')
watchAudits();
}
await client.release();
}