This file contains hidden or 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') | |
var notifier = require('./notifier.js') | |
mongoose.connection.on('connected', () => { | |
notifier.emit('mongodb_connected'); | |
}); | |
mongoose.connection.on('error', () => { | |
setTimeout(function () { | |
notifier.emit('mongodb_connect'); | |
}, 1000) | |
}); |
This file contains hidden or 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 { sql, getPool } = require(“./mssql.js”); | |
var notifier = require(‘./notifier.js’) | |
notifier.on(‘mssql_connected’, () => { | |
notifier.emit(‘start_process’); | |
}) | |
notifier.on(‘mssql_connect_error’, () => { | |
console.log(‘Impossible to connect to mssql !’); | |
}) |
This file contains hidden or 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
/* | |
MICROSOFT SQL | |
*/ | |
var sql = require(‘mssql’); | |
var notifier = require(‘./notifier.js’) | |
var config = { | |
user: “username”, | |
password: “Pass@word”, | |
server: ‘mssql’, |
This file contains hidden or 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
let EventEmitter = require('events').EventEmitter | |
let notifier = new EventEmitter() | |
module.exports = notifier |
NewerOlder