MCPcopy Create free account
hub / github.com/Bitbox-Connect/Bitbox / getVisitorCount

Function getVisitorCount

client/src/component/Footers/VisitorCount.jsx:20–31  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

18
19// Function to get the current visitor count
20async function getVisitorCount() {
21 try {
22 const response = await fetch(`${VITE_SERVER_PORT}/api/visitor/count`, {
23 method: "GET",
24 });
25 const data = await response.json();
26 return data.count;
27 } catch (error) {
28 console.error("Error retrieving visitor count:", error);
29 return null;
30 }
31}
32
33const VisitorCounter = () => {
34 const [visitorCount, setVisitorCount] = useState(null);

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected