-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
server.js
32 lines (28 loc) · 1 KB
/
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
27
28
29
30
31
32
'use strict';
/***********************************
* www.js is a file from where our *
* server is running **************
***********************************/
let www = require('./bin/www.js');
/***********************************
* dbConnection.js is a file from **
* where we are connecting our *****
* mongodb database **************
***********************************/
let db = require('./bin/db.connection.js');
/***********************************
* dbConfig.js is a file from we ***
****** are getting mongodb ********
********* configurations **********
***********************************/
let dbConfig = require('./src/configs/db.config.js');
/***********************************
* Database conectinvity before ****
***** running server (www()) ******
***********************************/
db(dbConfig.mongodb.url).then(resolve => {
console.log(`*************** DB is connected successfully **************`);
www();
}).catch(err => {
console.log(`*********** Error ${err} *******`);
});