feat(M02-A): 建立多小程序租户配置模型

This commit is contained in:
Codex
2026-06-18 10:30:31 +08:00
parent 9d13f75dc0
commit 8b8fb28c36
15 changed files with 459 additions and 15 deletions
+10 -1
View File
@@ -1,8 +1,17 @@
import { buildApp } from './app.js';
import { loadConfig } from './config.js';
import { closeMySqlPool, createMySqlPool } from './db/mysql.js';
import { PlatformConfigRepository } from './tenancy/platform-config-repository.js';
const config = loadConfig();
const app = await buildApp({ config });
const pool = createMySqlPool(config);
const app = await buildApp({
config,
platformConfigRepository: new PlatformConfigRepository(pool)
});
app.addHook('onClose', async () => {
await closeMySqlPool(pool);
});
try {
await app.listen({ host: config.host, port: config.port });