2022-09-27 14:41:17 -05:00
|
|
|
/// <reference no-default-lib="true" />
|
|
|
|
/// <reference lib="dom" />
|
|
|
|
/// <reference lib="dom.iterable" />
|
|
|
|
/// <reference lib="dom.asynciterable" />
|
|
|
|
/// <reference lib="deno.ns" />
|
|
|
|
|
|
|
|
import { start } from "$fresh/server.ts";
|
2022-10-01 14:03:15 -05:00
|
|
|
import manifest from "@/fresh.gen.ts";
|
2022-09-27 14:41:17 -05:00
|
|
|
|
|
|
|
import twindPlugin from "$fresh/plugins/twind.ts";
|
2022-10-01 14:03:15 -05:00
|
|
|
import twindConfig from "@/twind.config.ts";
|
2022-09-27 14:41:17 -05:00
|
|
|
|
2022-11-09 16:55:27 -06:00
|
|
|
import { log, setupLoggers } from "@/log.ts";
|
|
|
|
import { reload } from "@/config.ts";
|
|
|
|
import { initDatabaseConnectionPool } from "@/db/mod.ts";
|
2022-10-11 12:20:25 -05:00
|
|
|
|
2022-11-09 16:55:27 -06:00
|
|
|
const [config, configLoadLogCallbacks] = reload();
|
|
|
|
setupLoggers(config.log);
|
|
|
|
|
|
|
|
for (const f of configLoadLogCallbacks) {
|
|
|
|
f(log);
|
|
|
|
}
|
|
|
|
|
|
|
|
initDatabaseConnectionPool(config.postgres);
|
|
|
|
|
|
|
|
console.log = log.info;
|
|
|
|
console.debug = log.debug;
|
|
|
|
console.info = log.info;
|
|
|
|
console.warn = log.warning;
|
|
|
|
console.error = log.error;
|
2022-10-11 12:20:25 -05:00
|
|
|
|
2022-09-27 14:41:17 -05:00
|
|
|
await start(manifest, { plugins: [twindPlugin(twindConfig)] });
|