Skip to content

Commit 4256859

Browse files
committed
feat: add APP_HOST_BASE_URL env var and update app URL construction
1 parent 70f68b6 commit 4256859

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

app/config/env.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ export const CLOUD_SESSION_TOKEN_PUBLIC_KEY =
5454
// Vibes Service API
5555
export const API_BASE_URL = import.meta.env.VITE_API_BASE_URL || 'https://vibes-diy-api.com';
5656

57+
export const APP_HOST_BASE_URL = import.meta.env.VITE_APP_HOST_BASE_URL || 'https://vibesdiy.app';
58+
5759
// CallAI Endpoint
5860
export const CALLAI_ENDPOINT = import.meta.env.VITE_CALLAI_ENDPOINT || API_BASE_URL;
5961

app/utils/publishUtils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*/
44

55
import { fireproof } from 'use-fireproof';
6-
import { API_BASE_URL } from '../config/env';
6+
import { APP_HOST_BASE_URL, API_BASE_URL } from '../config/env';
77
import { getSessionDatabaseName, updateUserVibespaceDoc } from './databaseManager';
88
import { normalizeComponentExports } from './normalizeComponentExports';
99

@@ -130,7 +130,7 @@ export async function publishApp({
130130
const data = await response.json();
131131
if (data.success && data.app?.slug) {
132132
// Construct the app URL from the response data
133-
const appUrl = data.appUrl || `https://${data.app.slug}.${new URL(API_BASE_URL).hostname}`;
133+
const appUrl = data.appUrl || `https://${data.app.slug}.${new URL(APP_HOST_BASE_URL).hostname}`;
134134

135135
// Get the user's vibespace database to check for existing data
136136
const userVibespaceDb = fireproof(`vu-${userId}`);

0 commit comments

Comments
 (0)