I'm currently building up a microservice architecture with flask. I've been trying to figure out how to redirect users from one service's UI to another service's UI. The services will be hosted on AWS upon completion so hardcoding links wouldn't suffice.
For example: Submitting a form at localhost:8000/form will redirect the user to localhost:8001/anotherPage
Is there anything I can do within the html's javascript code or within flask python code? Appreciate any help!
The best way to do it is register an event in JavaScript
Then run the redirect command as
window.location.href = "http://www.w3schools.com";
function gohere(){
window.location.href = "http://www.w3schools.com";
}
document.getElementById("myBtn").addEventListener("click", gohere);
<button id="myBtn">click here</button>
You could also call the even automatically on window load .JavaScript is by default the client side goto scripting for events