From daefddd8dc45e7044e83bd40706cfdca36471fe9 Mon Sep 17 00:00:00 2001 From: Waref Haque Date: Tue, 19 Jul 2016 00:21:17 -0400 Subject: proper exams rendering --- app.js | 48 ------------------------------------------------ 1 file changed, 48 deletions(-) (limited to 'app.js') diff --git a/app.js b/app.js index e4d0843..ba7c014 100644 --- a/app.js +++ b/app.js @@ -32,51 +32,3 @@ app.use(express.static(__dirname)); app.use('/', routes); module.exports = app; - -app.listen(3000, function() { - console.log('listening on http://localhost:3000/'); -}); - -//to fetch exams given a course code and populate the exams page -app.get('/exams',function (req,res) { - console.log(req.query.search); - var courseName = req.query.search; - courseName = sanitizer.escape(courseName); - courseName = courseName.toUpperCase(); - console.log(courseName); - var result = getExamsForCourseCode(courseName); - console.log(result); - res.write(JSON.stringify(result)); -}); - -function getExamsForCourseCode(courseCode) { - var minExamInfoArray = []; - dbFile.get_all_exams(courseCode, function (exams) { - if (exams.length == 0){ - console.log("Nothing was found"); - } - else { - //console.log(exams); - //only pass over the information that is necessary for the exams page - for (var i = 0; i