interstellar_ai/app/backend/database.ts
Patrick_Pluto e31c7de7ab db backend
2024-09-25 09:10:14 +02:00

16 lines
No EOL
470 B
TypeScript

import axios from "axios";
const sendToDatabase = (data: any) => {
axios.post("http://localhost:5000/interstellar_ai/db", data)
.then(response => {
const status = response.data.status
console.log(status);
postMessage({ status })
console.log('message posted');
})
.catch(error => {
console.log("Error calling Database:", error)
postMessage({ status: 500 })
})
}