Guest User

Untitled

a guest
Sep 12th, 2018
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. using express to render a page got unexpected = error nodejs
  2. Unexpected token =
  3. at Object.Function (unknown source)
  4. at Object.compile (/home/tony/workspace/oa/node_modules/ejs/lib/ejs.js:209:12)
  5. at Function.compile
  6. at /home/job/workspace/oa/app.js:60:76
  7. at /home/job/workspace/oa/models.js:23:4
  8.  
  9. app.post('/login', function (req,res,next)
  10. {
  11. console.log('coming ');
  12. var username=req.body.username ;
  13. var password=req.body.password;
  14. reqin=req;
  15. resin=res;
  16. dbservice.findUser("usernamesome",function(err,result)
  17. {
  18. if (result.length==0) {//means not found
  19. console.log("length is "+result.length);
  20. resin.render('error',{message:'user not exist'});// render to
  21. //error page
  22. }
  23. else {
  24. console.log("length is "+result.length);
  25. }
  26. }
  27. );
  28. });
Add Comment
Please, Sign In to add comment