API
Use the API
import api from "../Api";//asynchronous GET
const response = await api.get("/")
console.log("Status", response.status)
console.log("Data", response.data)api.post("/sendData", {"data": "to send"}).then((response) => {
console.log("Data", response.data)
}).catch((error) => {
console.error("Error", error)
})Last updated