setup vite proxy for development
This commit is contained in:
@@ -47,14 +47,14 @@ function ProcessingPage() {
|
|||||||
|
|
||||||
console.log("Starting processing...");
|
console.log("Starting processing...");
|
||||||
|
|
||||||
processStep("http://127.0.0.1:8000/api/normalize", () => {
|
processStep("/api/normalize", () => {
|
||||||
processStep("http://127.0.0.1:8000/api/trim", () => {
|
processStep("/api/trim", () => {
|
||||||
if (response.audio_class === "Music") {
|
if (response.audio_class === "Music") {
|
||||||
processStep("http://127.0.0.1:8000/api/resample", () => {
|
processStep("/api/resample", () => {
|
||||||
processStep("http://127.0.0.1:8000/api/separate", () => setProgress(100), 100, "Separating sources into vocals, bass, drums and other...");
|
processStep("/api/separate", () => setProgress(100), 100, "Separating sources into vocals, bass, drums and other...");
|
||||||
}, 75, "Resampling audio to 44100Hz...", { sr: "44100" });
|
}, 75, "Resampling audio to 44100Hz...", { sr: "44100" });
|
||||||
} else {
|
} else {
|
||||||
processStep("http://127.0.0.1:8000/api/noisereduce", () => setProgress(100), 100, "Reducing background noise from the audio...");
|
processStep("/api/noisereduce", () => setProgress(100), 100, "Reducing background noise from the audio...");
|
||||||
}
|
}
|
||||||
}, 50, "Trimming silent parts from the audio...");
|
}, 50, "Trimming silent parts from the audio...");
|
||||||
}, 25, "Normalizing audio frequency...");
|
}, 25, "Normalizing audio frequency...");
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ function UploadPage() {
|
|||||||
file_uuid: string;
|
file_uuid: string;
|
||||||
sr: number;
|
sr: number;
|
||||||
audio_class: string;
|
audio_class: string;
|
||||||
}>("http://127.0.0.1:8000/api/upload", formData, {
|
}>("/api/upload", formData, {
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "multipart/form-data",
|
"Content-Type": "multipart/form-data",
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -4,4 +4,12 @@ import react from '@vitejs/plugin-react'
|
|||||||
// https://vite.dev/config/
|
// https://vite.dev/config/
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [react()],
|
plugins: [react()],
|
||||||
|
server: {
|
||||||
|
proxy: {
|
||||||
|
'/api': {
|
||||||
|
target: 'http://localhost:8000',
|
||||||
|
changeOrigin: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user