mirror of
https://github.com/NohamR/lanyard-profile-readme.git
synced 2026-05-25 20:00:40 +00:00
add count logging w redis + display on main page
This commit is contained in:
9
pages/api/getUserCount.ts
Normal file
9
pages/api/getUserCount.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import type { NextApiRequest, NextApiResponse } from "next";
|
||||
import redis from "../../src/redis";
|
||||
|
||||
export default async function handler(req: NextApiRequest, res: NextApiResponse) {
|
||||
let users = await redis.hgetall("users");
|
||||
let count = Object.keys(users);
|
||||
|
||||
res.status(200).send({ count: count.length });
|
||||
}
|
||||
Reference in New Issue
Block a user