diff options
| author | HumairAK <humair88@hotmail.com> | 2016-07-27 04:33:40 +0000 |
|---|---|---|
| committer | HumairAK <humair88@hotmail.com> | 2016-07-27 04:33:40 +0000 |
| commit | e98dd69d697ebbcc62615de299a8d30bba801d7f (patch) | |
| tree | 79522802b32d1cf9d7da160ea001ec7798ac8bd6 | |
| parent | 7a1479aaa052977201b3ed50db11e2855b5bdb2b (diff) | |
| parent | f3ea052f6b27c7d9f62c0486177a5c1d513e36ed (diff) | |
Merge branch 'master' of https://github.com/HumairAK/solutions_repo
| -rw-r--r-- | routes/index.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/routes/index.js b/routes/index.js index 9b8dad9..75f93c0 100644 --- a/routes/index.js +++ b/routes/index.js @@ -111,6 +111,16 @@ router.get('/exams/:id', function(req, res, next) { } }); +router.get('/user/',function (req, res) { + req.checkParams('username','Please enter a username').notEmpty(); + var errors = req.validationErrors(); + if (errors){ + req.session.errors = errors; + req.session.success = false; + res.redirect('/'); + } +}); + /* Render user search page based on query */ router.get('/user/:query', function(req,res,next){ var query = req.params.query; |
