fix: ensure SSR always fetches fresh assets from database #9

Merged
kfj001 merged 5 commits from bugfix/ssr-asset-freshness into main 2026-08-07 16:43:17 -07:00
2 changed files with 3 additions and 3 deletions
Showing only changes of commit c4e852684e - Show all commits

No files matched your search

+2 -2
View File
@@ -144,7 +144,7 @@ describe('nginx.conf.template — SSR proxy chain', () => {
const fs = require('fs'); const fs = require('fs');
const content = fs.readFileSync('./nginx.conf.template', 'utf-8'); const content = fs.readFileSync('./nginx.conf.template', 'utf-8');
expect(content).toContain('location ~*'); expect(content).toContain('location ~*');
expect(content).toContain('.js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot|map'); expect(content).toContain('js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot|map');
expect(content).toContain('expires 1y'); expect(content).toContain('expires 1y');
expect(content).toContain('public, immutable'); expect(content).toContain('public, immutable');
}); });
@@ -169,7 +169,7 @@ describe('main.server.ts — SSR API base URL injection', () => {
it('should read SSR_API_BASE_URL from environment with fallback', () => { it('should read SSR_API_BASE_URL from environment with fallback', () => {
const fs = require('fs'); const fs = require('fs');
const content = fs.readFileSync('./src/main.server.ts', 'utf-8'); const content = fs.readFileSync('./src/main.server.ts', 'utf-8');
expect(content).toContain("process.env.SSR_API_BASE_URL"); expect(content).toContain("process.env['SSR_API_BASE_URL']");
expect(content).toContain("http://localhost:80"); expect(content).toContain("http://localhost:80");
}); });
}); });
+1 -1
View File
@@ -9,7 +9,7 @@ import { serverRoutes } from './app/app.server.routes';
// During SSR, the API base URL must be absolute (HttpClient runs in Node.js). // During SSR, the API base URL must be absolute (HttpClient runs in Node.js).
// nginx proxies /api/ to the upstream, so point at nginx (port 80) locally. // nginx proxies /api/ to the upstream, so point at nginx (port 80) locally.
const ssrApiBaseUrl = process.env.SSR_API_BASE_URL || 'http://localhost:80'; const ssrApiBaseUrl = process.env['SSR_API_BASE_URL'] || 'http://localhost:80';
const ssrAppConfig: AppConfig = { apiBaseUrl: ssrApiBaseUrl }; const ssrAppConfig: AppConfig = { apiBaseUrl: ssrApiBaseUrl };
const serverAppConfig = { const serverAppConfig = {