-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathserver.js
More file actions
executable file
·41 lines (25 loc) · 878 Bytes
/
server.js
File metadata and controls
executable file
·41 lines (25 loc) · 878 Bytes
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
'use strict';
var express = require('express');
var app = express();
var config = require('./server/config/config');
require('./server/config/winston').init(config);
require('./server/tasks/jobs').init(config);
require('./server/config/mongoose')(config);
require('./server/config/express')(app, config);
require('./server/config/passport')();
require('./server/tasks/mailer').init(config);
var workers = require('./server/tasks/workers');
var jobs = workers.start(config);
process.on('SIGINT', function () {
console.log('server is shutting down');
jobs.shutdown(function (err) {
console.log('Kue is shut down.', err || '');
process.exit(0);
}, 5000);
});
require('./server/config/initDB').init(function(){
app.listen(config.port, function () {
console.log('Compass Listening on port ' + config.port + '...');
});
});
module.exports = app;