Initial setup
This commit is contained in:
36
client/src/scenes/Home/index.js
Normal file
36
client/src/scenes/Home/index.js
Normal file
@@ -0,0 +1,36 @@
|
||||
import React, { Component } from 'react';
|
||||
|
||||
class Home extends Component {
|
||||
state = {
|
||||
apiStatus: 'loading',
|
||||
};
|
||||
|
||||
componentDidMount() {
|
||||
fetch('/api')
|
||||
.then(response => response.json())
|
||||
.then(result => {
|
||||
console.log(result);
|
||||
if (result.status === 1) {
|
||||
this.setState({apiStatus: 'working'});
|
||||
} else {
|
||||
this.setState({apiStatus: 'NOT WORKING !'});
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
this.setState({apiStatus: `ERROR : ${err}`});
|
||||
})
|
||||
}
|
||||
|
||||
render () {
|
||||
const {apiStatus} = this.state;
|
||||
return (
|
||||
<div>
|
||||
<h3>CRM Integration</h3>
|
||||
<hr/>
|
||||
<h5>Integration API Status : {apiStatus}</h5>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Home;
|
||||
9
client/src/scenes/NotFound/index.js
Normal file
9
client/src/scenes/NotFound/index.js
Normal file
@@ -0,0 +1,9 @@
|
||||
import React from 'react';
|
||||
|
||||
export default function NotFound () {
|
||||
return (
|
||||
<div>
|
||||
<h1>Page not found</h1>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user