-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathenvTest.js
35 lines (28 loc) · 1.12 KB
/
envTest.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Load environment variables
import dotenv from 'dotenv';
import { fileURLToPath } from 'url';
import { dirname, join } from 'path';
import { existsSync } from 'fs';
// Get the directory name of the current module
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
// Log the current directory and .env file path
const envPath = join(__dirname, '.env');
console.log('Current directory:', __dirname);
console.log('.env file path:', envPath);
console.log('.env file exists:', existsSync(envPath));
// Configure dotenv with logging
const result = dotenv.config({ debug: true });
if (result.error) {
console.log('Error loading .env file:', result.error);
} else {
console.log('.env file loaded successfully');
}
// Log all environment variables
console.log('\nAll environment variables:');
console.log(process.env);
// Print environment variables
console.log('SUPABASE_PROJECT_ID:', process.env.SUPABASE_PROJECT_ID)
console.log('SERVICE_ROLE_KEY:', process.env.SERVICE_ROLE_KEY)
console.log('VITE_SUPABASE_URL:', process.env.VITE_SUPABASE_URL)
console.log('SUPABASE_URL:', process.env.SUPABASE_URL)