forked from pinks/eris
1
0
Fork 0
eris/main.ts

27 lines
636 B
TypeScript
Raw Permalink Normal View History

2023-10-13 18:05:23 +00:00
/// <reference lib="deno.unstable" />
2023-09-26 10:43:36 +00:00
import "std/dotenv/load.ts";
import { ConsoleHandler } from "std/log/handlers.ts";
2023-10-15 19:13:38 +00:00
import { LevelName, setup } from "std/log/mod.ts";
2023-10-05 09:00:51 +00:00
import { serveUi } from "./api/mod.ts";
import { runAllTasks } from "./app/mod.ts";
2023-10-13 16:10:16 +00:00
import { runBot } from "./bot/mod.ts";
2023-10-15 19:13:38 +00:00
const logLevel = Deno.env.get("LOG_LEVEL")?.toUpperCase() as LevelName ?? "INFO";
2023-09-26 10:43:36 +00:00
// setup logging
2023-09-24 13:08:35 +00:00
setup({
handlers: {
2023-10-15 19:13:38 +00:00
console: new ConsoleHandler(logLevel),
},
loggers: {
2023-10-15 19:13:38 +00:00
default: { level: logLevel, handlers: ["console"] },
},
});
2023-09-03 19:06:20 +00:00
2023-09-26 10:43:36 +00:00
// run parts of the app
2023-09-04 16:55:48 +00:00
await Promise.all([
2023-10-13 16:10:16 +00:00
runBot(),
2023-09-10 18:56:17 +00:00
runAllTasks(),
2023-10-05 09:00:51 +00:00
serveUi(),
2023-09-03 19:06:20 +00:00
]);