diff --git a/artifacts/api-server/src/app.ts b/artifacts/api-server/src/app.ts index 96dbb90..5ce6888 100644 --- a/artifacts/api-server/src/app.ts +++ b/artifacts/api-server/src/app.ts @@ -18,7 +18,12 @@ const rawOrigins = process.env["CORS_ORIGINS"]; const allowedOrigins: string[] = rawOrigins ? rawOrigins.split(",").map((o) => o.trim()).filter(Boolean) : isProd - ? ["https://alexanderwhitestone.com", "https://www.alexanderwhitestone.com"] + ? [ + "https://alexanderwhitestone.com", + "https://www.alexanderwhitestone.com", + "https://alexanderwhitestone.ai", + "https://www.alexanderwhitestone.ai", + ] : []; app.use( @@ -53,6 +58,12 @@ const towerDist = path.resolve(process.cwd(), "the-matrix", "dist"); app.use("/tower", express.static(towerDist)); app.get("/tower/*splat", (_req, res) => res.sendFile(path.join(towerDist, "index.html"))); +// Vite builds asset references as absolute /assets/... paths. +// Mirror them at the root so the browser can load them from /tower. +app.use("/assets", express.static(path.join(towerDist, "assets"))); +app.use("/sw.js", express.static(path.join(towerDist, "sw.js"))); +app.use("/manifest.json", express.static(path.join(towerDist, "manifest.json"))); + app.get("/", (_req, res) => { res.setHeader("Content-Type", "text/html"); res.send(`