Cleanup constants

This commit is contained in:
Dana Woodman 2018-08-12 13:51:14 -07:00
parent 4149e32196
commit d080a09e7e

View File

@ -3,28 +3,19 @@ const path = require('path')
require('dotenv').config({ path: path.join(__dirname, '.env') }) require('dotenv').config({ path: path.join(__dirname, '.env') })
const ENV = process.env.NODE_ENV || 'development' const ENV = process.env.NODE_ENV || 'development'
const USB_MOUNT_PATH = process.env.USB_MOUNT_PATH || '/mnt/sda1'
const CARDS_PATH = path.join(
USB_MOUNT_PATH,
process.env.CARDS_PATH || 'cards.json'
)
module.exports = { module.exports = {
CARDS_PATH,
CARD_UPDATE_INTERVAL: process.env.CARD_UPDATE_INTERVAL || 30 * 1000, CARD_UPDATE_INTERVAL: process.env.CARD_UPDATE_INTERVAL || 30 * 1000,
// Cobot // Cobot
COBOT_CARDS_API: COBOT_CARDS_API:
process.env.COBOT_CARDS_API || process.env.COBOT_CARDS_API ||
'https://chimera.cobot.me/api/check_in_tokens', 'https://chimera.cobot.me/api/check_in_tokens',
COBOT_CLIENT_ID: COBOT_CLIENT_ID: process.env.COBOT_CLIENT_ID,
process.env.COBOT_CLIENT_ID || '7c3e837a765a28c1a47d24599695bd0a', COBOT_CLIENT_SECRET: process.env.COBOT_CLIENT_SECRET,
COBOT_CLIENT_SECRET: COBOT_SCOPE: 'checkin_tokens',
process.env.COBOT_CLIENT_SECRET || COBOT_USER_EMAIL: process.env.COBOT_USER_EMAIL,
'e4da8ce36c6cb4f792390166a82841c209bc53339e796f59edd3739e6b069889', COBOT_USER_PASSWORD: process.env.COBOT_USER_PASSWORD,
COBOT_SCOPE: process.env.COBOT_SCOPE || 'checkin_tokens',
COBOT_USER_EMAIL: process.env.COBOT_USER_EMAIL || 'dana@chimeraarts.org',
COBOT_USER_PASSWORD: process.env.COBOT_USER_PASSWORD || 'save me time',
DOOR_OPEN_DELAY: ENV === 'test' ? 1 : 6000, DOOR_OPEN_DELAY: ENV === 'test' ? 1 : 6000,
ENV, ENV,
@ -34,6 +25,4 @@ module.exports = {
NEXUDUS_SECRET_KEY: process.env.NEXUDUS_SECRET_KEY, NEXUDUS_SECRET_KEY: process.env.NEXUDUS_SECRET_KEY,
RFID_READER_SERIAL_NUMBER: process.env.RFID_READER_SERIAL_NUMBER, RFID_READER_SERIAL_NUMBER: process.env.RFID_READER_SERIAL_NUMBER,
USB_MOUNT_PATH,
} }