forked from React-Group/interstellar_ai
db backend
This commit is contained in:
parent
a8cf1b4dcf
commit
e31c7de7ab
1 changed files with 16 additions and 0 deletions
16
app/backend/database.ts
Normal file
16
app/backend/database.ts
Normal 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 })
|
||||
})
|
||||
}
|
Loading…
Reference in a new issue