aboutsummaryrefslogtreecommitdiff
path: root/routes/index.js
diff options
context:
space:
mode:
authorNana Nosirova <nargiza.nosirova@mail.utoronto.ca>2018-07-17 02:44:31 +0000
committerGitHub <noreply@github.com>2018-07-17 02:44:31 +0000
commit77168116122c0c5e37405fddaee785efca414f6e (patch)
tree32a4bcfc6b591e25ca86bb55fafc8f5e75c2a118 /routes/index.js
parentc9f4e0e9df821c305b9606bd9575d3092384205b (diff)
parent60a53ac331e33cab3173a6803dcf11de3ff47ae6 (diff)
Merge pull request #3 from kdam0/feat/SR-26qa
Feat/SR-26
Diffstat (limited to 'routes/index.js')
-rw-r--r--routes/index.js13
1 files changed, 12 insertions, 1 deletions
diff --git a/routes/index.js b/routes/index.js
index fe1cdb8..04ee1ff 100644
--- a/routes/index.js
+++ b/routes/index.js
@@ -18,6 +18,17 @@ router.get('/', function(req, res, next) {
});
+router.get('/auto-complete-courses', function(req, res, next) {
+
+ // console.log('in controller');
+ dbFile.find_all_course_codes_from_exams( function (success, data) {
+ var res_obj = {};
+ res_obj.success = success;
+ res_obj.data = data;
+ res.send(JSON.stringify(res_obj));
+ });
+});
+
/** Serve the about.hbs page */
router.get('/about', function(req, res, next) {
res.render('about');
@@ -316,4 +327,4 @@ function toProperCase(string) {
return string.replace(/\w\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});
}
-module.exports = router; \ No newline at end of file
+module.exports = router;