aboutsummaryrefslogtreecommitdiff
path: root/routes
diff options
context:
space:
mode:
authorNana Nosirova <nargiza.nosirova@mail.utoronto.ca>2018-07-17 02:44:47 +0000
committerGitHub <noreply@github.com>2018-07-17 02:44:47 +0000
commit62b53c0971765a4e5f5d447188eb90bd22571424 (patch)
treed2f7aa3f3bb7b05cd5d3dee288eabf0f38d39b1a /routes
parent541341598d5ed0e5c8ef9b2325dc6bbec958463a (diff)
parent27f1cff089254b678bfcc695ab40b23a6a65a998 (diff)
Merge pull request #4 from kdam0/feat/SR-35
Feat/sr 35
Diffstat (limited to 'routes')
-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;