Files
llm-in-text/src/utils/config.js
T

19 lines
526 B
JavaScript
Raw Normal View History

export const DEBUG = import.meta.env.DEV
export const API_URL = import.meta.env.VITE_API_URL || 'http://localhost:8000/v1/completions'
const buildDefaultOcrUrl = (apiUrl) => {
if (typeof window === 'undefined') {
return 'http://localhost:8000/v1/ocr'
}
try {
const url = new URL(apiUrl, window.location.origin)
url.pathname = '/v1/ocr'
return url.toString()
} catch {
return 'http://localhost:8000/v1/ocr'
}
}
export const OCR_URL = import.meta.env.VITE_OCR_URL || buildDefaultOcrUrl(API_URL)