fix: ensure SSR always fetches fresh assets from database #9
No files matched your search
+2
-2
@@ -144,7 +144,7 @@ describe('nginx.conf.template — SSR proxy chain', () => {
|
||||
const fs = require('fs');
|
||||
const content = fs.readFileSync('./nginx.conf.template', 'utf-8');
|
||||
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('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', () => {
|
||||
const fs = require('fs');
|
||||
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");
|
||||
});
|
||||
});
|
||||
+1
-1
@@ -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).
|
||||
// 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 serverAppConfig = {
|
||||
|
||||
Reference in new issue
Block a user