diff --git a/src/components/HealthComponent.js b/src/components/HealthComponent.js new file mode 100644 index 0000000..804fe6b --- /dev/null +++ b/src/components/HealthComponent.js @@ -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.status === 'healthy'); + } catch (error) { + setIsHealthy(false); + } + }; + fetchHealth(); + }, []); + + return ( +