posting and commenting

This commit is contained in:
Adolfo Reyna
2021-07-29 10:25:05 -07:00
parent 6904ad913e
commit 4069054117
4 changed files with 119 additions and 2 deletions

View File

@@ -1,5 +1,6 @@
const mongo = require('mongodb');
const MongoClient = mongo.MongoClient;
const ObjectID = mongo.ObjectID;
const DBName = "EMI_SOCIAL";
const mongoUrl = process.env.MONGO_URL;
const postDB = require("./dbTools/post.js");
@@ -11,6 +12,7 @@ const getDB = new Promise((resolve, reject) => {
if (err) return reject(err);
DB.db = db;
DB.ObjectID = ObjectID;
console.log("Connected to DB!");
DB.usersCol = db.db(DBName).collection("users");
DB.tokensCol = db.db(DBName).collection("tokens");