-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.ts
More file actions
29 lines (24 loc) · 813 Bytes
/
main.ts
File metadata and controls
29 lines (24 loc) · 813 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/// <reference no-default-lib="true" />
/// <reference lib="dom" />
/// <reference lib="dom.asynciterable" />
/// <reference lib="deno.ns" />
/// <reference lib="deno.unstable" />
import { InnerRenderFunction, RenderContext, start } from "$fresh/server.ts";
import manifest from "./fresh.gen.ts";
import { UnoCSS } from "./utils/unocss.ts";
import { DB } from "./database/db.ts";
const unoCSS = new UnoCSS();
async function render(ctx: RenderContext, render: InnerRenderFunction) {
const body = render();
const unoCSSOutput = await unoCSS.render(body);
ctx.styles.splice(
0,
ctx.styles.length,
...unoCSSOutput,
...(ctx.styles ?? []),
);
}
const db = DB.getInstance();
const sql = await db.selectFrom("user").selectAll().execute();
console.log(sql);
await start(manifest, { render });