React connection testing
Thu Jan 27 2022 22:06:23 GMT+0000 (Coordinated Universal Time)
Saved by
@Taylor
class connectionInitial extends React.Component {
componentDidMount() {
const apiUrl = "http://127.0.0.1:8000/api/profile/";
fetch(apiUrl)
.then((response) => response.json())
.then((data) => console.log(data));
}
render() {
return <div>Test connection</div>;
}
}
export default connectionInitial;
content_copyCOPY
Comments