18 lines
579 B
TypeScript
18 lines
579 B
TypeScript
import dotenv from 'dotenv';
|
|
|
|
dotenv.config();
|
|
|
|
export const config = {
|
|
// GPIO pin number for relay control
|
|
relayPin: process.env.RELAY_PIN ? parseInt(process.env.RELAY_PIN) : 18,
|
|
|
|
// Duration to hold relay active (milliseconds)
|
|
triggerDuration: process.env.TRIGGER_DURATION ? parseInt(process.env.TRIGGER_DURATION) : 500,
|
|
|
|
// Maximum time gate can be open (milliseconds)
|
|
maxOpenTime: process.env.MAX_OPEN_TIME ? parseInt(process.env.MAX_OPEN_TIME) : 5 * 60 * 1000, // 5 minutes
|
|
|
|
// Database file location
|
|
dbPath: process.env.DB_PATH || 'gatekeeper.db'
|
|
};
|