From 230bffab3c67a5e77b09c82f31dc449e3305b1fc Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Fri, 15 May 2026 06:18:58 -0400 Subject: [PATCH] bundle assets by default --- Containerfile | 1 - src/index.ts | 14 ++------------ 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/Containerfile b/Containerfile index b834de1..745c0d0 100644 --- a/Containerfile +++ b/Containerfile @@ -3,7 +3,6 @@ WORKDIR /app COPY package.json bun.lock ./ RUN bun install --frozen-lockfile COPY . . -RUN bun run build ENV NODE_ENV=production EXPOSE 3000 CMD ["bun", "run", "src/index.ts"] diff --git a/src/index.ts b/src/index.ts index d5b98b8..f51859a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,10 +1,8 @@ import { serve } from "bun"; -import { join } from "path"; +import index from "./index.html"; import { privateApps } from "./data/privateApps"; import { websites } from "./data/websites"; -const distDir = join(import.meta.dir, "..", "dist"); - let hnCache: { stories: any[]; fetchedAt: number } | null = null; let lobstersCache: { stories: any[]; fetchedAt: number } | null = null; @@ -116,15 +114,7 @@ const server = serve({ hostname: "0.0.0.0", port: 3000, routes: { - // Serve static assets from dist/, with index.html fallback for SPA routes. - "/*": async (req) => { - const url = new URL(req.url); - const candidate = Bun.file( - join(distDir, url.pathname === "/" ? "index.html" : url.pathname), - ); - if (await candidate.exists()) return new Response(candidate); - return new Response(Bun.file(join(distDir, "index.html"))); - }, + "/": index, "/api/check": { async POST(req) { -- 2.51.2