Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //POST login
- app.post('/login', urlencodedParser, function(req,res){
- userLogin(req.body, function(response){
- if(response == true){
- //Activate player login in db
- loginPlayerDB(req.body.username);
- getPlayerId(req.body.username, function(id){
- res.redirect(req.baseUrl + '/:id/profile');
- });
- } else{
- res.send(500, "Username or Password is incorrect");
- }
- })
- });
- app.get('/:id/profile', function(req,res){
- res.render('profile/profile');
- })
- http://localhost:3000/:id/profile
- http://localhost:3000/6/profile
Add Comment
Please, Sign In to add comment