From 8547b87b120101803a989ac768e3ffba4785c451 Mon Sep 17 00:00:00 2001 From: Joe Mou Date: Sun, 25 Jan 2026 13:16:25 -0500 Subject: esbuild to bundle for deployment --- src/index.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/index.ts b/src/index.ts index a546f13..c934530 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,13 +1,17 @@ -import { Hono } from "hono"; import { serve } from "@hono/node-server"; import { serveStatic } from "@hono/node-server/serve-static"; import { Eta } from "eta"; -import { getGitHubTree, getGitHubBlob } from "./scraper.js"; +import { Hono } from "hono"; +import * as path from "node:path"; +import * as url from "node:url"; +import { getGitHubBlob, getGitHubTree } from "./scraper.js"; + +const __dirname = path.dirname(url.fileURLToPath(import.meta.url)); const app = new Hono(); -const eta = new Eta({ views: "./views" }); +const eta = new Eta({ views: path.join(__dirname, "..", "views") }); -app.use("/static/*", serveStatic({ root: "." })); +app.use("/static/*", serveStatic({ root: path.join(__dirname, "..") })); app.get("/:owner/:repo/tree/:branch/:path{.*}?", async (c) => { try { -- cgit v1.3.1