Advertisement
maxrusmos

Untitled

Feb 6th, 2020
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. var bool = false;
  2. var user = '';
  3. app.post("/login", urlencodedParser, function (request, response){
  4. if (!request.body) return response.sendStatus(400);
  5. console.log(request.body);
  6.  
  7. if (request.body.userName == "maxrusmos") bool = true;
  8. else bool = false;
  9.  
  10. user = request.body.userName;
  11. response.sendFile(__dirname + "/index.html");
  12. });
  13.  
  14. app.get("/login", urlencodedParser, function (request, response){
  15. response.send(
  16. {
  17. "bool": bool,
  18. "username": user
  19. });
  20. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement