From d62cd4c1eb1bd821e564006f26ff468f1896f7ae Mon Sep 17 00:00:00 2001 From: Replit Agent Date: Thu, 19 Mar 2026 14:39:29 +0000 Subject: [PATCH] fix: serve tower assets at /assets root + add .ai CORS origin - Mirror /tower/assets at /assets so Vite absolute paths load correctly - Add alexanderwhitestone.ai and www.alexanderwhitestone.ai to CORS allowlist --- artifacts/api-server/src/app.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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(`