This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var amqp = require('amqplib') | |
var open = require('amqplib').connect('amqp://localhost'); | |
const connect = (url = 'amqp://localhost') => { | |
return new Promise((resolve, reject) => { | |
amqp.connect(url) | |
.then(conn => resolve(conn)) | |
.catch(err => reject(err)) | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const mongoose = require('mongoose') | |
mongoose.Promise = Promise | |
mongoose.connection.on('connected', () => { | |
console.log('Connection Established') | |
}) | |
mongoose.connection.on('reconnected', () => { | |
console.log('Connection Reestablished') |
OlderNewer