-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathserver.js
26 lines (19 loc) · 916 Bytes
/
server.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
'use strict';
var mean = require('meanio');
mean.serve({ }, function (app) {
var config = app.config.clean;
var port = config.https && config.https.port ? config.https.port : config.http.port;
console.log('Mean app started on port ' + port + ' (' + process.env.NODE_ENV + ')');
var cron = require('node-cron');
var taskController = require(__dirname + '/packages/custom/icu/server/controllers/task.js');
cron.schedule(config.ScheduledMailSendWeekly, function(){
console.log('running a task every week');
taskController.GetUsersWantGetMyWeeklyTasksMail();
taskController.GetUsersWantGetGivenWeeklyTasksMail();
});
cron.schedule(config.ScheduledMailSendDaly, function(){
console.log('running a task every day');
taskController.GetUsersWantGetMyTodayTasksMail();
taskController.GetUsersWantGetGivenTodayTasksMail();
});
});