routes on files

This commit is contained in:
Adolfo Reyna
2021-08-07 20:49:02 -07:00
parent 4069054117
commit 5b9c0362e0
8 changed files with 222 additions and 101 deletions

View File

@@ -4,6 +4,7 @@ const ObjectID = mongo.ObjectID;
const DBName = "EMI_SOCIAL";
const mongoUrl = process.env.MONGO_URL;
const postDB = require("./dbTools/post.js");
const userDB = require("./dbTools/user.js");
const getDB = new Promise((resolve, reject) => {
@@ -34,7 +35,6 @@ const getDB = new Promise((resolve, reject) => {
}
DB.newUser = (userInformation)=>{
console.log("NewUser", userInformation);
return DB.usersCol.insertOne(userInformation).catch((err)=>{
console.log(err);
return false;
@@ -51,6 +51,7 @@ const getDB = new Promise((resolve, reject) => {
}
postDB(DB);
userDB(DB);
resolve(DB);
});