add auth-service not verified with Dockerfile
This commit is contained in:
parent
3a7389ba68
commit
8cf6520224
12 changed files with 304 additions and 0 deletions
18
backend/service-authentication/mongodbConnect.js
Normal file
18
backend/service-authentication/mongodbConnect.js
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
const config = require('./config');
|
||||
const MongoClient = require( 'mongodb' ).MongoClient;
|
||||
const uri = config.mongodbHost;
|
||||
let db;
|
||||
|
||||
module.exports = {
|
||||
connectToServer: function( callback ) {
|
||||
MongoClient.connect( uri, { useNewUrlParser: true, useUnifiedTopology: true }, function( err, client ) {
|
||||
db = client.db(config.mongodbDatabase);
|
||||
return callback( err );
|
||||
});
|
||||
},
|
||||
|
||||
getDB: function() {
|
||||
return db;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in a new issue