Skip to content

Commit 992bd42

Browse files
committed
chore(webapp): add temporary /build-version compat shim
Serve the current build id at /build-version so an already-deployed client build that polls it after a /build asset 404 recovers in a single reload instead of a manual-reload dead-end. Endpoint only — deliberately no X-Build-Id response header. Temporary; safe to remove once older clients have churned out.
1 parent 9d190b8 commit 992bd42

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

apps/webapp/server.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,15 @@ if (ENABLE_CLUSTER && cluster.isPrimary) {
134134
const port = process.env.REMIX_APP_PORT || process.env.PORT || 3000;
135135

136136
if (process.env.HTTP_SERVER_DISABLED !== "true") {
137+
// Back-compat shim: a previously-deployed client build polls this endpoint after a
138+
// /build asset 404 and reloads once it reports a newer build id, letting those older
139+
// tabs recover in a single reload. Temporary — safe to remove once older clients have
140+
// churned out. Deliberately does NOT set an X-Build-Id response header.
141+
app.get("/build-version", (_req, res) => {
142+
res.set("Cache-Control", "no-store");
143+
res.json({ version: build.assets.version });
144+
});
145+
137146
const socketIo: { io: IoServer } | undefined = build.entry.module.socketIo;
138147
const wss: WebSocketServer | undefined = build.entry.module.wss;
139148
const apiRateLimiter: RateLimitMiddleware = build.entry.module.apiRateLimiter;

0 commit comments

Comments
 (0)