Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using express to render a page got unexpected = error nodejs
- Unexpected token =
- at Object.Function (unknown source)
- at Object.compile (/home/tony/workspace/oa/node_modules/ejs/lib/ejs.js:209:12)
- at Function.compile
- at /home/job/workspace/oa/app.js:60:76
- at /home/job/workspace/oa/models.js:23:4
- app.post('/login', function (req,res,next)
- {
- console.log('coming ');
- var username=req.body.username ;
- var password=req.body.password;
- reqin=req;
- resin=res;
- dbservice.findUser("usernamesome",function(err,result)
- {
- if (result.length==0) {//means not found
- console.log("length is "+result.length);
- resin.render('error',{message:'user not exist'});// render to
- //error page
- }
- else {
- console.log("length is "+result.length);
- }
- }
- );
- });
Add Comment
Please, Sign In to add comment