Skip to content

Commit

Permalink
fix base url
Browse files Browse the repository at this point in the history
  • Loading branch information
swuecho committed Dec 10, 2023
1 parent c9aaebc commit 7e259a2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion web/src/views/chat/components/AudioPlayer/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const isActive = ref(false);
// const speaker_id = ref('')
// const style_wav = ref('')
// const language_id = ref('')
const BASE_URL = import.meta.env.VITE_GLOB_API_URL
// Add a method called 'playAudio' to handle sending the request to the backend.
Expand All @@ -25,7 +26,7 @@ async function playAudio() {
let text = encodeURIComponent(props.text)
try {
// Perform the HTTP request to send the request to the backend.
const response = await fetch(`/api/tts?text=${text}`,
const response = await fetch(`${BASE_URL}/tts?text=${text}`,
{ cache: 'no-cache' });
if (response.ok) {
// If the HTTP response is successful, parse the body into an object and play the sound.
Expand Down

0 comments on commit 7e259a2

Please sign in to comment.