On button click
After making python api call, react application is getting reloaded.
tried adding e.preventDefault still no luck
app.py returns below code
return jsonify({"file_path": file_path})
From react calls tried like below
const response = await axios.post('http://127.0.0.1:5000/upload_images', {
images: imageFilesArray
});
console.log('Upload successful:', response.data);
fetch("http://127.0.0.1:5000/rewrite_json", requestOptions)
.then((response) => response.text())
.then((result) => console.log(result))
.catch((error) => console.error(error));