diff --git a/src/aggregator/index.ts b/src/aggregator/index.ts index 115ab69..b53357c 100644 --- a/src/aggregator/index.ts +++ b/src/aggregator/index.ts @@ -16,10 +16,14 @@ import { parseTask } from "../markdown/parser.ts"; import type { Task } from "../types/index.ts"; import { sortByTaskId } from "../utils/task-sorting.ts"; -// @ts-expect-error - Bun HTML import -import indexHtml from "./web/index.html"; // @ts-expect-error - Bun file import import favicon from "../web/favicon.png" with { type: "file" }; +import { dirname, join as pathJoin } from "node:path"; +import { fileURLToPath } from "node:url"; + +// Get the directory of this file +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); interface ProjectConfig { path: string; @@ -87,7 +91,16 @@ export class BacklogAggregator { port: this.config.port, development: process.env.NODE_ENV === "development", routes: { - "/": indexHtml, + "/": async () => { + const htmlPath = pathJoin(__dirname, "web", "index.html"); + const htmlFile = Bun.file(htmlPath); + return new Response(htmlFile, { headers: { "Content-Type": "text/html" } }); + }, + "/app.tsx": async () => { + const tsxPath = pathJoin(__dirname, "web", "app.tsx"); + const tsxFile = Bun.file(tsxPath); + return new Response(tsxFile, { headers: { "Content-Type": "application/javascript" } }); + }, "/api/projects": { GET: async () => this.handleGetProjects(), }, diff --git a/src/aggregator/web/index.html b/src/aggregator/web/index.html index f18111b..dab290a 100644 --- a/src/aggregator/web/index.html +++ b/src/aggregator/web/index.html @@ -5,9 +5,316 @@ Backlog Aggregator - Real-time Task View - + -
+
+
+

Backlog Aggregator

+ Connecting... +
+
Loading...
+
+ +
+ + +
+ +
+
+
+

To Do

+ 0 +
+
+
+
+
+

In Progress

+ 0 +
+
+
+
+
+

Done

+ 0 +
+
+
+
+ +