Initial commit: tischlerctrl home automation project
This commit is contained in:
18
server/src/config.js
Normal file
18
server/src/config.js
Normal file
@@ -0,0 +1,18 @@
|
||||
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),
|
||||
};
|
||||
Reference in New Issue
Block a user