aboutsummaryrefslogtreecommitdiff
path: root/routes
diff options
context:
space:
mode:
authorkdam0 <kumar.damani@mail.utoronto.ca>2017-01-30 05:02:09 +0000
committerkdam0 <kumar.damani@mail.utoronto.ca>2017-01-30 05:02:09 +0000
commit98c9cbc6258f699fc944f025230c35faf8575bc2 (patch)
treef2c1e809bb2b2573d88ef9bd77eafa65808dca94 /routes
parent541341598d5ed0e5c8ef9b2325dc6bbec958463a (diff)
feat. added auto fill for search bar.
Diffstat (limited to 'routes')
-rw-r--r--routes/index.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/routes/index.js b/routes/index.js
index fe1cdb8..31f5442 100644
--- a/routes/index.js
+++ b/routes/index.js
@@ -18,6 +18,14 @@ 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 (data) {
+ res.send(JSON.stringify(data));
+ });
+});
+
/** Serve the about.hbs page */
router.get('/about', function(req, res, next) {
res.render('about');
@@ -316,4 +324,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;