diff --git a/app.js b/app.js index 7a3d11d8d..cf5382adb 100644 --- a/app.js +++ b/app.js @@ -35,10 +35,5 @@ app.get("/*", function (req, res) { // /party is the place where the homescreen will be app.use("/", indexRouter); app.use("/party", partyPageRouter); -// const PORT = process.env.PORT || 3001; -// app.listen(PORT, () => { -// console.log(`Mixing it up on port ${PORT}`); -// }); -// catch 404 and forward to error handler module.exports = app; diff --git a/db/myMongoDb.js b/db/myMongoDb.js index c7f0dde4f..f385e68b7 100644 --- a/db/myMongoDb.js +++ b/db/myMongoDb.js @@ -1,6 +1,8 @@ var express = require("express"); var session = require("express-session"); const MongoClient = require("mongodb").MongoClient; + +//Best to not expose mongo credentials const mongoURL = "mongodb+srv://lpanavas:Password1@cluster0.b9bcp.mongodb.net/?retryWrites=true&w=majority"; diff --git a/front/src/App.css b/front/src/App.css index 74b5e0534..0bf6d4608 100644 --- a/front/src/App.css +++ b/front/src/App.css @@ -1,3 +1,4 @@ +/** Better to put css files in a folder! **/ .App { text-align: center; } diff --git a/node_modules/.bin/acorn b/node_modules/.bin/acorn index c31c43046..12d947cbd 100644 --- a/node_modules/.bin/acorn +++ b/node_modules/.bin/acorn @@ -1,3 +1,5 @@ +#node_modules should be added in git ignore and not pushed to the repo! + #!/bin/sh basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") diff --git a/public/javascripts/main.js b/public/javascripts/main.js deleted file mode 100644 index 3fde8d081..000000000 --- a/public/javascripts/main.js +++ /dev/null @@ -1,78 +0,0 @@ -// var express = require('express'); - -// const myDB = require('../../db/myMongoDb.js'); -// var CommentBox = React.createClass({ -// render: function() { -// return ( -//
-// Hello, world! I am a CommentBox. -//
-// ); -// } -// }); -// React.renderComponent( -// , -// document.getElementById('content') -// ); -// alert("hello"); -// var CommentBox = React.createClass({ -// render: function() { -// return ( -//
-// Hello, world! I am a CommentBox. -//
-// ); -// } -// }); -// React.renderComponent( -// , -// document.getElementById('content') -// ); -// console.log(myDB); - -// document.getElementById("content").innerHTML = "whaasfdasdfasdfadsfdsafdsafdsatever"; - -// cardContainer = document.getElementById('card-container'); -// const results = await myDB.getParties(); -// console.log(results); -// cardContainer.innerHTML = results; - -// let cardContainer; - -// let createTaskCard = (task) => { - -// let card = document.createElement('div'); -// card.className = 'card shadow cursor-pointer'; - -// let cardBody = document.createElement('div'); -// cardBody.className = 'card-body'; - -// let title = document.createElement('h5'); -// title.innerText = task.title; -// title.className = 'card-title'; - -// let color = document.createElement('div'); -// color.innerText = task.color; -// color.className = 'card-color'; - - -// cardBody.appendChild(title); -// cardBody.appendChild(color); -// card.appendChild(cardBody); -// cardContainer.appendChild(card); - -// } - -// let initListOfTasks = async() => { -// if (cardContainer) { -// document.getElementById('card-container').replaceWith(cardContainer); -// return; -// } - -// cardContainer = document.getElementById('card-container'); -// const results = await myDB.getParties(); -// cardContainer.innerHTML = results; -// // tasks.forEach((task) => { -// // createTaskCard(task); -// // }); -// }; \ No newline at end of file diff --git a/routes/comments.js b/routes/comments.js index 6e95768aa..1446cf65b 100644 --- a/routes/comments.js +++ b/routes/comments.js @@ -6,7 +6,6 @@ const myDB = require('../db/myMongoDb.js') var ObjectId = require('mongodb').ObjectId; router.get('/:commentID', async (req, res) => { - // console.log('hello'); var id = req.params.commentID; var o_id = new ObjectId(id); diff --git a/routes/index.js b/routes/index.js index 8746d3561..2273ab6d9 100644 --- a/routes/index.js +++ b/routes/index.js @@ -1,6 +1,7 @@ var express = require("express"); const app = require("../app"); var session = require("express-session"); + // import connectStore from "connect-mongo"; var router = express.Router(); diff --git a/views/comments/cardHome.ejs b/views/comments/cardHome.ejs index 373d8f077..084eaa12e 100644 --- a/views/comments/cardHome.ejs +++ b/views/comments/cardHome.ejs @@ -26,6 +26,8 @@
+ +