diff options
| author | Joe Mou <dev@mou.fo> | 2026-01-25 13:16:25 -0500 |
|---|---|---|
| committer | Joe Mou <dev@mou.fo> | 2026-01-25 17:46:15 -0500 |
| commit | b8784e25b76039c1ce0cfedee6aa50d5446579f9 (patch) | |
| tree | 572dbda80ea5296e89877fd951ff36de7a7c54a6 /cgithub/src | |
| parent | a64548630c531d7a7960f5e83d727a8bd423deaa (diff) | |
esbuild to bundle for deployment
Diffstat (limited to 'cgithub/src')
| -rw-r--r-- | cgithub/src/index.ts | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/cgithub/src/index.ts b/cgithub/src/index.ts index a546f13..c934530 100644 --- a/cgithub/src/index.ts +++ b/cgithub/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 { |
