Clean up index.ts and implement basic http server
This commit is contained in:
16
index.ts
16
index.ts
@@ -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()
|
||||
})()
|
||||
|
||||
Reference in New Issue
Block a user