-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathserver.js
More file actions
35 lines (27 loc) · 746 Bytes
/
server.js
File metadata and controls
35 lines (27 loc) · 746 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
var http = require('http')
, app = require('./app')
, models = require('./models')
;
function start(done) {
http.createServer(app).listen(app.get('port'), app.get('bindip'), function(){
console.log("Express server listening on port " + app.get('port'));
var syncArgs = {};
if ("development" === process.NODE_ENV) {
syncArgs.force = true;
}
models._sequelize.sync(syncArgs).done(function(err){
if (err) throw err;
var poller = new models.poller({
FeedClass: models.Feed
, mailer: new models.mailer()
});
poller.start();
console.log("POLLING FEEDS");
done();
});
});
}
module.exports = start;
if (module === require.main){
start(function(){});
}