require env var

This commit is contained in:
Alex Grintsvayg 2016-09-08 12:47:31 -04:00
parent 811f571530
commit 598da3405d

2
app.js
View file

@ -1,7 +1,7 @@
var SlackBot = require('slackbots'); var SlackBot = require('slackbots');
var request = require('request'); var request = require('request');
['SLACK_TOKEN', 'RPCUSER', 'RPCPASSWORD'].forEach(function(envVar) { ['SLACK_TOKEN', 'RPCUSER', 'RPCPASSWORD', 'IMGUR_CLIENT_ID'].forEach(function(envVar) {
if (!process.env[envVar]) { if (!process.env[envVar]) {
throw new Error(envVar + ' env var required'); throw new Error(envVar + ' env var required');
} }