build(docker): add runtime-configured frontend image

This commit is contained in:
2026-07-11 21:57:53 +02:00
parent 31023f9e7a
commit 3d939426b1
9 changed files with 150 additions and 1 deletions
+17
View File
@@ -0,0 +1,17 @@
import { describe, expect, it } from "vitest";
import { backendBaseUrl, resolveBackendUrl } from "./runtime-config";
describe("resolveBackendUrl", () => {
it("uses the runtime-injected backend URL", () => {
expect(resolveBackendUrl({ backendBaseUrl: "/api" })).toBe("/api");
});
it("falls back to the Vite backend URL", () => {
expect(resolveBackendUrl(undefined)).toBe(import.meta.env.VITE_BACKEND_URL ?? "");
});
it("preserves the client default when Vite has no configured backend", () => {
expect(backendBaseUrl).toBe(import.meta.env.VITE_BACKEND_URL ?? "http://localhost:8787");
});
});