()
| 18 | |
| 19 | // Function to get the current visitor count |
| 20 | async 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 | |
| 33 | const VisitorCounter = () => { |
| 34 | const [visitorCount, setVisitorCount] = useState(null); |
no outgoing calls
no test coverage detected