add connection
This commit is contained in:
parent
ca057706a5
commit
68f48b0c09
1 changed files with 9 additions and 1 deletions
|
|
@ -1,4 +1,12 @@
|
||||||
const mongoose = require("mongoose")
|
const config = require('../config');
|
||||||
|
const mongoose = require( 'mongoose' );
|
||||||
|
const url = config.mongodbHost+config.mongodbDatabase;
|
||||||
|
|
||||||
|
mongoose.connect(url,({useNewUrlParser: true, useUnifiedTopology: true})).then( function(){
|
||||||
|
console.log('mongodb-privated-room connected '+mongoose.connection.readyState);
|
||||||
|
}).catch(function(err){
|
||||||
|
console.log('error : '+err);
|
||||||
|
});
|
||||||
|
|
||||||
const ConversationSchema = new mongoose.Schema(
|
const ConversationSchema = new mongoose.Schema(
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Reference in a new issue