Skip to content

Instantly share code, notes, and snippets.

@yasudacloud
Created April 7, 2023 13:20
Show Gist options
  • Save yasudacloud/19f6862f09308b04ad87f9c6302f767d to your computer and use it in GitHub Desktop.
Save yasudacloud/19f6862f09308b04ad87f9c6302f767d to your computer and use it in GitHub Desktop.
import * as api from './http/api'
function App() {
const onClick = async () => {
const client = api.DefaultApiFactory(undefined, 'http://localhost:8000')
const response = await client.rootGet()
console.log(response.data)
}
return (
<div className="App">
<div style={{margin: 100}}>
<button onClick={onClick}>APIを叩く</button>
</div>
</div>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment