-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
38 lines (26 loc) · 819 Bytes
/
index.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
33
34
35
36
37
38
const express = require('express');
const app = express();
const mongoose = require('mongoose');
const {MONGO_DB_CONFIG} = require('./config/app.config');
const http = require('http');
const { error } = require('console');
const server = http.createServer(app);
const {initMeetingServer} = require('./meeting-server');
initMeetingServer(server);
//meeting-server
//initMeetingServer(server)
mongoose.Promise = global.Promise;
mongoose.connect(MONGO_DB_CONFIG.DB,{
useNewUrlParser :true,
useUnifiedTopology :true
})
.then(()=>{
console.log("Detabase Connected");
},(error)=>{
console.log("Detabase Cnn,t be Connected "+error);
});
app.use(express.json());
app.use("/api",require('./routes/app.routes'));
server.listen(process.env.port || 4000, function(){
console.log("Ready to go!")
});