google bard

google bard

import React, { useEffect } from "react";
const App = () => {
useEffect(() => {
const url = "https://example.com";
fetch(url, {
method: "GET",
})
.then((response) => {
if (response.status === 200) {
console.log("Server is up!");
} else {
console.log("Server is down!");
}
})
.catch((error) => {
console.log("Error pinging server:", error);
});
}, []);
return (
);
};
export default App;