Compare commits

..

2 commits

Author SHA1 Message Date
Patrick_Pluto
816f61fd6e Merge branch 'main' of interstellardevelopment.org:React-Group/interstellar_ai 2024-10-07 09:17:39 +02:00
Patrick_Pluto
588d783b47 started with fixing ssr 2024-10-07 09:17:31 +02:00

View file

@ -19,7 +19,11 @@ to check if the request was accepted or declined, check response.data.response,
*/
const apiURL = new URL("http://localhost:5000/interstellar_ai/db")
apiURL.hostname = window.location.hostname;
if (typeof window !== 'undefined') {
apiURL.hostname = window.location.hostname;
} else {
apiURL.hostname = "localhost"
}
export const sendToDatabase = async (data: object): Promise<boolean> => {
try {