- Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.js
More file actions
Latest commit
31 lines (25 loc) · 812 Bytes
/
Copy pathindex.js
File metadata and controls
31 lines (25 loc) · 812 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
varexpress=require('express'),
router=express.Router(),
fs=require('fs'),
config=require('./config/config'),
passport=require('passport');
varmodelsPath=__dirname+'/app/models';
fs.readdirSync(modelsPath).forEach(function(file){
if(file.indexOf('.js')>=0){
require(modelsPath+'/'+file);
}
});
varapp=express();
varhttp=require('http').Server(app);
require('./config/express')(app,config,router,passport);
require('./config/passport')(passport);
require('./config/routes')(app,router,passport);
require('./config/socket')(http);
vardb=require('./config/db');
db.once('open',function(){
console.log("Connected to Database: "+config.db);
});
http.listen(config.port,function(){
console.log('listening on port '+config.port);
});
module.exports=app;