env variables handling
This commit is contained in:
10
js/app.js
10
js/app.js
@@ -4,7 +4,6 @@ import * as state from './core/state.js';
|
||||
import * as ui from './ui/ui.js';
|
||||
import * as timer from './core/timer.js';
|
||||
import camera from './ui/camera.js'; // Default export
|
||||
import { initEnv } from './env-loader.js';
|
||||
import * as pushSettingsUI from './ui/pushSettingsUI.js'; // Import the new push settings UI module
|
||||
|
||||
// Import externalized modules
|
||||
@@ -21,8 +20,13 @@ async function initialize() {
|
||||
|
||||
// 0. Wait for environment variables to load
|
||||
try {
|
||||
await initEnv();
|
||||
console.log("Environment variables loaded");
|
||||
// Use the ensureEnvLoaded function from config.js to make sure environment variables are loaded
|
||||
await config.ensureEnvLoaded();
|
||||
console.log("Environment variables loaded and verified");
|
||||
|
||||
// Log the loaded environment variables for debugging
|
||||
console.log("BACKEND_URL:", config.getBackendUrl());
|
||||
console.log("PUBLIC_VAPID_KEY:", config.getPublicVapidKey());
|
||||
} catch (error) {
|
||||
console.warn("Failed to load environment variables, using defaults:", error);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user