nginx / src /App.js
Xiao
testing huggingface 5000 api
5815d8e
raw
history blame
1.18 kB
import logo from './logo.svg';
import './App.css';
function App() {
const handleButtonClick1 = () => {
fetch('http://localhost:5000/')
.then((response) => response.json())
.then((data) => console.log(data.message))
.catch((error) => console.error('An error occurred:', error));
};
const handleButtonClick2 = () => {
fetch('http://localhost:5000/api/')
.then((response) => response.json())
.then((data) => console.log(data.message))
.catch((error) => console.error('An error occurred:', error));
};
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<p>
Edit <code>src/App-1.js</code> and save to reload.
</p>
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React -- - 10
</a>
<div>
<button onClick={handleButtonClick1}>Ping /</button>
<button onClick={handleButtonClick2}>Ping /api</button>
</div>
</header>
</div>
);
}
export default App;