aboutsummaryrefslogtreecommitdiffstats
path: root/routes
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2017-09-09 21:58:47 -0700
committerAdam Soltys <[email protected]>2017-09-09 21:58:47 -0700
commitce0c25444f6d752944bbc962ae210cf24042f8d3 (patch)
tree051ff98c48ac0b4ab02791c948f4952cebc80b32 /routes
parente30ba71ea6559d741209af9f8dfcd83133caa55d (diff)
downloadcoinos-server-ce0c25444f6d752944bbc962ae210cf24042f8d3.tar.gz
coinos-server-ce0c25444f6d752944bbc962ae210cf24042f8d3.zip
use dotenv for config
Diffstat (limited to 'routes')
-rw-r--r--routes/transactions.js14
-rw-r--r--routes/users.js3
2 files changed, 5 insertions, 12 deletions
diff --git a/routes/transactions.js b/routes/transactions.js
index c6a86271..7cf7f408 100644
--- a/routes/transactions.js
+++ b/routes/transactions.js
@@ -1,13 +1,7 @@
(function() {
- var Promise, config, db, moment, txid;
-
- Promise = require('bluebird');
-
- db = require('../redis');
-
- config = require("../config");
-
- moment = require('moment');
+ const Promise = require('bluebird')
+ const db = require('../redis')
+ const moment = require('moment')
txid = function(transaction, user) {
if (transaction.match(/[a-z]/i)) {
@@ -84,7 +78,7 @@
subject = 'Payment Received';
content = new helper.Content('text/html', html);
mail = new helper.Mail(from_email, subject, to_email, content);
- sg = require('sendgrid')(config.sendgrid_token);
+ sg = require('sendgrid')(process.env.SENDGRID_TOKEN);
request = sg.emptyRequest({
method: 'POST',
path: '/v3/mail/send',
diff --git a/routes/users.js b/routes/users.js
index 3e05be9d..b27de7ad 100644
--- a/routes/users.js
+++ b/routes/users.js
@@ -1,6 +1,5 @@
const Promise = require('bluebird')
const db = require("../redis")
-const config = require("../config")
const bcrypt = require('bcrypt')
const fs = require('fs')
const request = require('request')
@@ -98,7 +97,7 @@ module.exports = {
const subject = 'Welcome to CoinOS'
const content = new helper.Content('text/html', req.body.privkey)
const mail = new helper.Mail(from_email, subject, to_email, content)
- const sg = require('sendgrid')(config.sendgrid_token)
+ const sg = require('sendgrid')(process.env.SENDGRID_TOKEN)
const ereq = sg.emptyRequest({
method: 'POST',
path: '/v3/mail/send',