fix ssr
This commit is contained in:
parent
2e67f911c1
commit
0f610d3c18
11 changed files with 408 additions and 288 deletions
|
@ -6,7 +6,11 @@ export const sendToVoiceRecognition = (audio_data: Blob): Promise<string> => {
|
|||
formdata.append("audio", audio_data)
|
||||
|
||||
const apiURL = new URL("http://localhost:5000/interstellar_ai/api/voice_recognition")
|
||||
apiURL.hostname = window.location.hostname;
|
||||
if (typeof window !== 'undefined') {
|
||||
apiURL.hostname = window.location.hostname;
|
||||
} else {
|
||||
apiURL.hostname = "localhost"
|
||||
}
|
||||
|
||||
return axios.post(apiURL.href, formdata)
|
||||
.then((response) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue