daily pastebin goal
69%
SHARE
TWEET

Untitled

a guest Feb 18th, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //POST login
  2.  app.post('/login', urlencodedParser, function(req,res){
  3.     userLogin(req.body, function(response){
  4.         if(response == true){
  5.             //Activate player login in db
  6.             loginPlayerDB(req.body.username);
  7.             getPlayerId(req.body.username, function(id){
  8.                 res.redirect(req.baseUrl + '/:id/profile');
  9.             });
  10.         } else{
  11.             res.send(500, "Username or Password is incorrect");
  12.         }
  13.     })
  14. });
  15.    
  16. app.get('/:id/profile', function(req,res){
  17.     res.render('profile/profile');
  18. })
  19.    
  20. http://localhost:3000/:id/profile
  21.    
  22. http://localhost:3000/6/profile
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top