feat: use API base URL from env

This commit is contained in:
Kailasdevdas
2026-04-16 19:49:06 +05:30
parent 959440e1c6
commit 39e162f65c
5 changed files with 14 additions and 11 deletions
@@ -14,6 +14,7 @@ export function BytescaleUploader({
onChange,
folderPath,
}: BytescaleUploaderProps) {
const baseURL = import.meta.env.VITE_API_URL;
const [isUploading, setIsUploading] = useState(false);
const fileInputRef = useRef<HTMLInputElement>(null);
@@ -33,15 +34,11 @@ export function BytescaleUploader({
formData.append("folderPath", folderPath);
try {
const response = await axios.post(
"http://localhost:3000/api/upload",
formData,
{
headers: {
"Content-Type": "multipart/form-data",
},
const response = await axios.post(`${baseURL}/upload`, formData, {
headers: {
"Content-Type": "multipart/form-data",
},
);
});
const {fileUrl} = response.data;
onChange(fileUrl);