File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,19 +6,7 @@ import { env } from '$env/dynamic/private';
66
77const CACHE_API_KEY = env . CACHE_INVALIDATION_API_KEY || 'your-secret-key' ;
88
9- // Determine the production app URL based on environment
10- const getProductionAppUrl = ( ) : string => {
11- // If explicitly set in environment, use that
12- if ( env . PUBLIC_STORE_URL ) {
13- return env . PUBLIC_STORE_URL ;
14- }
15-
16- // Auto-detect based on environment
17- const isDocker = env . NODE_ENV === 'production' || env . HOST === '0.0.0.0' ;
18- return isDocker ? 'http://hotelhunger-app:3000' : 'http://localhost:3000' ;
19- } ;
20-
21- const PRODUCTION_APP_URL = getProductionAppUrl ( ) ;
9+ const PRODUCTION_APP_URL = env . STORE_FRONT_URL || 'http://localhost:3000' ;
2210
2311interface CacheInvalidationRequest {
2412 type : 'product' | 'category' | 'all' ;
@@ -40,7 +28,7 @@ export async function invalidateProductionCache(
4028 apiKey : CACHE_API_KEY
4129 } ;
4230
43- console . log ( `[Cache Coordination] Targeting hotelhunger- app: ${ PRODUCTION_APP_URL } ` ) ;
31+ console . log ( `[Cache Coordination] Targeting storefront app: ${ PRODUCTION_APP_URL } ` ) ;
4432 console . log ( `[Cache Coordination] Sending cache invalidation request: type=${ type } , id=${ id } ` ) ;
4533
4634 const response = await fetch ( `${ PRODUCTION_APP_URL } /api/cache/invalidate` , {
You can’t perform that action at this time.
0 commit comments