Guest User

Untitled

a guest
Feb 18th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  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
Add Comment
Please, Sign In to add comment