19 lines
669 B
JavaScript
19 lines
669 B
JavaScript
import { config } from 'dotenv';
|
|
import { fileURLToPath } from 'url';
|
|
import { dirname, join } from 'path';
|
|
|
|
const __filename = fileURLToPath(import.meta.url);
|
|
const __dirname = dirname(__filename);
|
|
|
|
// Load environment variables from .env file
|
|
config({ path: join(__dirname, '..', '.env') });
|
|
|
|
export default {
|
|
port: parseInt(process.env.PORT || '8080', 10),
|
|
dbPath: process.env.DB_PATH || join(__dirname, '..', 'data', 'sensors.db'),
|
|
|
|
// Job intervals
|
|
aggregationIntervalMs: parseInt(process.env.AGGREGATION_INTERVAL_MS || String(10 * 60 * 1000), 10),
|
|
cleanupIntervalMs: parseInt(process.env.CLEANUP_INTERVAL_MS || String(60 * 60 * 1000), 10),
|
|
};
|