diff --git a/src/components/HealthComponent.jsx b/src/components/HealthComponent.jsx new file mode 100644 index 0000000..60a6966 --- /dev/null +++ b/src/components/HealthComponent.jsx @@ -0,0 +1,32 @@ +import React, { useEffect, useState } from 'react'; + +const HealthComponent = () => { + const [isHealthy, setIsHealthy] = useState(null); + + useEffect(() => { + const fetchHealth = async () => { + try { + const response = await fetch('/api/v1/health'); + const data = await response.json(); + setIsHealthy(data.health); + } catch (error) { + setIsHealthy(false); + } + }; + + fetchHealth(); + }, []); + + return ( +