db backend

This commit is contained in:
Patrick_Pluto 2024-09-25 09:10:14 +02:00
parent a8cf1b4dcf
commit e31c7de7ab

16
app/backend/database.ts Normal file
View file

@ -0,0 +1,16 @@
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 })
})
}