-
Notifications
You must be signed in to change notification settings - Fork 0
/
reminders.js
55 lines (40 loc) · 1.18 KB
/
reminders.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
~~ Promiser ~~
*/
//////////////////
// Dependencies //
//////////////////
// NodeJS Utilities
var https = require('https'),
http = require("http"),
url = require('url'),
path = require('path'),
crypto = require('crypto'),
util = require('util'),
// Environment
env = process.env.NODE_ENV || 'development',
port = process.env.PORT || 3000,
config = require('./config/config')(path, port)[env],
// Mongoose
mongoose = require('mongoose'),
// Models
Agreement = require('./app/models/agreement')(mongoose),
EmailLog = require('./app/models/emailLog')(mongoose),
// Mandrill
mandrill = require('node-mandrill')('htx3b7X3BJ3Z2hs-RSOmfg'),
email = require('./app/email')(mandrill, EmailLog),
// Async
async = require('async'),
// BCrypt
bcrypt = require('bcrypt'),
// Templates
promises = require('./app/templates/promises')(util),
emails = require('./app/templates/emails')(util, config, crypto),
// Cron Jobs
cron = require('cron').CronJob,
reminders = require('./app/jobs/cronJobs')(cron, Agreement, email, async, util, emails);
///////////////////
// Configuration //
///////////////////
// Database -> Mongoose to MongoDB
require('./config/mongoose')(mongoose, config);