Skip to content

Commit cc98443

Browse files
committed
users
1 parent 3b78fbe commit cc98443

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

webserver/app.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,19 @@ def register_username():
297297
}), 201
298298

299299

300+
@app.route('/api/user/count')
301+
def get_user_count():
302+
"""Get the total number of registered users"""
303+
if not redis_client:
304+
return jsonify({'error': 'Database unavailable'}), 503
305+
306+
count = redis_client.get('users:count')
307+
308+
return jsonify({
309+
'total_users': int(count) if count else 0
310+
})
311+
312+
300313
if __name__ == '__main__':
301314
# Local development server
302315
print(f"Games directory: {GAMES_DIR}")

0 commit comments

Comments
 (0)