File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
apps/sim/app/api/proxy/tts Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change 11import { NextResponse } from 'next/server'
22import { createLogger } from '@/lib/logs/console-logger'
33import { uploadFile } from '@/lib/uploads/storage-client'
4+ import { getBaseUrl } from '@/lib/urls/utils'
45
56const logger = createLogger ( 'ProxyTTSAPI' )
67
@@ -51,10 +52,8 @@ export async function POST(request: Request) {
5152 const fileName = `elevenlabs-tts-${ timestamp } .mp3`
5253 const fileInfo = await uploadFile ( audioBuffer , fileName , 'audio/mpeg' )
5354
54- // Generate the full URL for external use
55- const host = request . headers . get ( 'host' ) || 'localhost:3000'
56- const protocol = request . headers . get ( 'x-forwarded-proto' ) || 'http'
57- const audioUrl = `${ protocol } ://${ host } ${ fileInfo . path } `
55+ // Generate the full URL for external use using the configured base URL
56+ const audioUrl = `${ getBaseUrl ( ) } ${ fileInfo . path } `
5857
5958 return NextResponse . json ( {
6059 audioUrl,
You can’t perform that action at this time.
0 commit comments