first commit
This commit is contained in:
15
config/collections/dbkebengkel.js
Normal file
15
config/collections/dbkebengkel.js
Normal file
@ -0,0 +1,15 @@
|
||||
const mongoose = require('mongoose');
|
||||
// const dburl='mongodb://root:s4lasan2016@150.242.110.114:27017/dbmidtpay?authSource=admin';
|
||||
const dburl='mongodb://root:s4lasan2016@103.84.192.250:27017/dbkebengkel?authSource=admin';
|
||||
|
||||
mongoose.Promise = global.Promise;
|
||||
mongoose.connect(dburl,{ useNewUrlParser: true, useUnifiedTopology: true },function(err) {
|
||||
if (err) {
|
||||
console.error('Error connecting: ' + err.stack);
|
||||
return;
|
||||
}
|
||||
console.log('Collection established');
|
||||
//db.close();
|
||||
});
|
||||
|
||||
module.exports = mongoose;
|
||||
20
config/dbproc.js
Normal file
20
config/dbproc.js
Normal file
@ -0,0 +1,20 @@
|
||||
// console.log(libinit.gethost);
|
||||
const mysql = require('mysql');
|
||||
const dbcon = mysql.createConnection({
|
||||
host : process.env.HOSTDB,
|
||||
user : process.env.USERDB,
|
||||
password : "ssotcel#20i7",
|
||||
database : process.env.DBHOST,
|
||||
acquireTimeout: 30000,
|
||||
insecureAuth: true,
|
||||
timezone: 'utc'
|
||||
});
|
||||
|
||||
dbcon.connect(function(err) {
|
||||
if (err) {
|
||||
console.error('Error connecting: '+process.env.PASSDB+' ' + err.stack);
|
||||
return;
|
||||
}
|
||||
console.log('WS Ver 1.0.0 Proc connected');
|
||||
});
|
||||
module.exports = dbcon;
|
||||
Reference in New Issue
Block a user