33 lines
877 B
TypeScript
33 lines
877 B
TypeScript
/// <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";
|
|
import manifest from "@/fresh.gen.ts";
|
|
|
|
import twindPlugin from "$fresh/plugins/twind.ts";
|
|
import twindConfig from "@/twind.config.ts";
|
|
|
|
import { log, setupLoggers } from "@/log.ts";
|
|
import { reload } from "@/config.ts";
|
|
import { initDatabaseConnectionPool } from "@/db/mod.ts";
|
|
|
|
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;
|
|
|
|
await start(manifest, { plugins: [twindPlugin(twindConfig)] });
|