Clean up index.ts and implement basic http server

This commit is contained in:
2025-01-20 21:50:40 -05:00
parent 36e21fcf7d
commit a0e9061352
7 changed files with 152 additions and 14 deletions

View File

@@ -1,7 +1,17 @@
import {ensureDirectoriesExist} from "./src/config.ts";
import {refreshThreadsEntirely} from "./src/threads/refresh.ts";
import {config, ensureDirectoriesExist} from "./src/config.ts";
import {UnitManager} from "./src/bones/Unit.ts";
import {ThreadRefresher} from "./src/units/threads.ts";
import {HttpServer} from "./src/units/http-server.ts";
;(async () => {
await ensureDirectoriesExist()
await refreshThreadsEntirely()
const manager = new UnitManager()
await manager.addUnit(new ThreadRefresher)
if ( config.http.enabled ) {
await manager.addUnit(new HttpServer)
}
await manager.run()
})()