Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added .env support #54 #55

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env_sample
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SLACK_TOKEN=[your_slack_token]
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
*.swp
*.swo
node_modules/
.env
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"main": "main.js",
"dependencies": {
"blessed": "^0.1.56",
"dotenv": "^4.0.0",
"node-notifier": "^5.0.2",
"request": "^2.55.0",
"ws": "^0.7.1"
Expand Down
3 changes: 3 additions & 0 deletions slackClient.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
const fs = require('fs');
const request = require('request');
const WebSocket = require('ws');
// Load in the environment variables
const dotenv = require('dotenv');

dotenv.load({ path: '.env' });
const TOKEN = process.env.SLACK_TOKEN;

if (TOKEN === undefined) {
Expand Down