|
@ -2,7 +2,7 @@ var path = require('path'); |
|
|
var app = require('express')(); |
|
|
var app = require('express')(); |
|
|
var http = require('http').Server(app); |
|
|
var http = require('http').Server(app); |
|
|
var io = require('socket.io')(http); |
|
|
var io = require('socket.io')(http); |
|
|
var MongoClient = require('mongodb').MongoClient; |
|
|
//var MongoClient = require('mongodb').MongoClient;
|
|
|
|
|
|
|
|
|
//const socketAuth = require('socketio-auth');
|
|
|
//const socketAuth = require('socketio-auth');
|
|
|
|
|
|
|
|
@ -65,7 +65,7 @@ cors(corsOptions), (req, res, next) => { |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
// ------------------------------------------------
|
|
|
// ------------------------------------------------
|
|
|
|
|
|
/* |
|
|
var mongouser = "playgrounduser"; |
|
|
var mongouser = "playgrounduser"; |
|
|
var mongopass = "efvvnuioervefSDFSGYGHRDFVsdfergvssppiiedifhwincvinviw_dbfjbsifbsdkjfswuunscfudfgbbfvibqefwrvnine"; |
|
|
var mongopass = "efvvnuioervefSDFSGYGHRDFVsdfergvssppiiedifhwincvinviw_dbfjbsifbsdkjfswuunscfudfgbbfvibqefwrvnine"; |
|
|
const mongourl = 'mongodb://'+mongouser+':'+mongopass+'@node1:27017/?replicaSet=rs0'; |
|
|
const mongourl = 'mongodb://'+mongouser+':'+mongopass+'@node1:27017/?replicaSet=rs0'; |
|
@ -78,6 +78,7 @@ var mongooption = { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
// Create a new MongoClient
|
|
|
// Create a new MongoClient
|
|
|
|
|
|
|
|
|
const client = new MongoClient(mongourl, mongooption); |
|
|
const client = new MongoClient(mongourl, mongooption); |
|
|
|
|
|
|
|
|
var dbName; |
|
|
var dbName; |
|
@ -101,7 +102,7 @@ client.connect(function(err) { |
|
|
//client.close();
|
|
|
//client.close();
|
|
|
}); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|