fix cert and image display issues
This commit is contained in:
@@ -12,8 +12,8 @@ import path from 'node:path';
|
||||
import bcrypt from 'bcrypt';
|
||||
import { logger } from '../services/logger.server';
|
||||
|
||||
// Determine base URL based on environment
|
||||
// Dev container: https://127.0.0.1
|
||||
// Determine base URL for flyer images based on environment
|
||||
// Dev container: https://127.0.0.1 (NGINX now accepts both localhost and 127.0.0.1)
|
||||
// Test: https://flyer-crawler-test.projectium.com
|
||||
// Production: https://flyer-crawler.projectium.com
|
||||
const BASE_URL =
|
||||
|
||||
@@ -15,7 +15,7 @@ export const getTestBaseUrl = (): string => {
|
||||
/**
|
||||
* Get the flyer base URL for test data based on environment.
|
||||
* Uses FLYER_BASE_URL if set, otherwise detects environment:
|
||||
* - Dev container: http://127.0.0.1
|
||||
* - Dev container: https://localhost (NOT 127.0.0.1 - avoids SSL mixed-origin issues)
|
||||
* - Test: https://flyer-crawler-test.projectium.com
|
||||
* - Production: https://flyer-crawler.projectium.com
|
||||
* - Default: https://example.com (for unit tests)
|
||||
@@ -26,8 +26,10 @@ export const getFlyerBaseUrl = (): string => {
|
||||
}
|
||||
|
||||
// Check if we're in dev container (DB_HOST=postgres is typical indicator)
|
||||
// Use 'localhost' instead of '127.0.0.1' to match the hostname users access
|
||||
// This avoids SSL certificate mixed-origin issues in browsers
|
||||
if (process.env.DB_HOST === 'postgres' || process.env.DB_HOST === '127.0.0.1') {
|
||||
return 'http://127.0.0.1';
|
||||
return 'https://localhost';
|
||||
}
|
||||
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
|
||||
Reference in New Issue
Block a user