1const reactData = [{ id: 1, name:' Tom'}, { id: 2, name:' Sarah'}];
2const url = localhost:4000/api/users/register;
3
4let sendData = () => {
5axios.post(url, reactData)
6 .then(res => console.log('Data send'))
7 .catch(err => console.log(err.data))
8}
1const url = localhost:4000/api/users/register;
2const usersData= [];
3
4let getData = () => {
5axios.get(url)
6 .then(res => usersData.push(res.data))
7 .catch(err => console.log(err.data))
8}