/** * Increase the people count via POST request. */ app.post('/increase', (req, res) => { // Confirm request has correct key before allowing change. if(!req.query.key || req.query.key !== process.env.KEY) return res.sendStatus(401) // Increase people count in redis by 1 redis.incr('people_count', (err, newPeopleCount) => { if(err) return res.sendStatus(500) // Send new people count to listening sockets io.emit('UPDATE_COUNT', newPeopleCount) // Respond to POST request with new people count. res.json({ count: newPeopleCount }) }) })
return [null, null, 'Please wait some time before creating a new user.']; let id = await $r.incr('users.count'); let auth_token = await getRand(); let apisecret = await getRand();