typescriptified and also removed hardcoded addresses
This commit is contained in:
parent
61919ad094
commit
091744d75b
5 changed files with 42 additions and 18 deletions
|
@ -5,7 +5,10 @@ export const sendToVoiceRecognition = (audio_data: Blob): Promise<string> => {
|
|||
const formdata = new FormData()
|
||||
formdata.append("audio", audio_data)
|
||||
|
||||
return axios.post("http://localhost:5000/interstellar_ai/api/voice_recognition", formdata)
|
||||
const apiURL = new URL("http://localhost:5000/interstellar_ai/api/voice_recognition")
|
||||
apiURL.hostname = window.location.hostname;
|
||||
|
||||
return axios.post(apiURL.href, formdata)
|
||||
.then((response) => {
|
||||
return response.data.response
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue