Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- app.get('/stats',ensureAuthenticated, function(req, res){
- var token = req.get("Authorization")
- , decoded = jwt.verify(token, secret)
- , steamId = decoded.steamid;
- if(admins.indexOf(steamId) > -1){
- Mongo.query("jackpots", {"status": "open"}, function(jackpotResult){
- var jackpotEarnings = 0;
- for (var i = 0; i < jackpotResult.length; i++) {
- jackpotEarnings = jackpotEarnings + (jackpotResult[i].totalAmountBeforeFee - jackpotResult[i].winnerAmount);
- }
- res.json({"successfull": true, "jackpot": jackpotEarnings});
- res.end();
- });
- }else{
- res.json({"successfull": false});
- res.end();
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement