From e31c7de7ab4b752dd5edacbe3f0eba597001e0dc Mon Sep 17 00:00:00 2001 From: Patrick_Pluto Date: Wed, 25 Sep 2024 09:10:14 +0200 Subject: [PATCH] db backend --- app/backend/database.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 app/backend/database.ts diff --git a/app/backend/database.ts b/app/backend/database.ts new file mode 100644 index 0000000..7b7437d --- /dev/null +++ b/app/backend/database.ts @@ -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 }) + }) +} \ No newline at end of file