refactored and moved a lot of code around to separate files

This commit is contained in:
Kasper Rynning-Tønnesen
2017-09-12 16:50:26 +02:00
parent 657ace250a
commit 977d3846f4
13 changed files with 1712 additions and 1571 deletions

13
server/handlers/db.js Normal file
View File

@@ -0,0 +1,13 @@
var mongo_db_cred = {config: 'mydb'};
var mongojs = require('mongojs');
var db = mongojs(mongo_db_cred.config);
db.on('connected', function(err) {
console.log("connected");
})
db.on('error',function(err) {
console.log("\n" + new Date().toString() + "\n Database error: ", err);
});
module.exports = db;