Add transport-neutral routing and stream contracts

This commit is contained in:
2026-07-27 09:31:35 +00:00
parent c0a8936828
commit e4ceacade8
7 changed files with 426 additions and 2 deletions
+13 -2
View File
@@ -1,5 +1,6 @@
import { Config } from './services/config.ts';
import { Database, MigrationService } from './services/storage/index.ts';
import { ApplicationRouter } from './services/router.ts';
import { Logger } from './utils/logger.ts';
/** Application composition root. */
@@ -17,12 +18,22 @@ export class App {
const migrations = new MigrationService(database, debug);
await migrations.migrateToLatest();
return new App(database);
const routes = [];
// Route loading is an explicit startup phase, not first-request work.
// ApplicationRouter.create validates every path and rejects duplicates
// before any client can connect.
const router = await ApplicationRouter.create(routes);
return new App(database, router);
}
private stopPromise: Promise<void> | undefined;
constructor(private readonly database: Database) {}
constructor(
private readonly database: Database,
private readonly router: ApplicationRouter,
) {}
async start(): Promise<void> {}