I am stuck on this problem. The backend APIs are written in Node.js and I am handling these APIs in the frontend which is in React.js. The backend and frontend code has separate repository structure. So all login, signup and forget password functionality will be done through client-side requests.
The APIs endpoints are deployed on the server which has the following URL structure.
POST - https://133.44.163.89:5000/user/forgetPassword
GET - https://133.44.163.89:5000/user/56546dsfsd
Now I am consuming these endpoints in my frontend local environment which has the following URL.
http://localhost:3000
I am facing a problem with the forgotten password endpoint basically it is a post request and takes user email in the body.
POST - https://133.44.163.89:5000/user/forgetPassword
body: { email: 'example@example.com' }
On the successful response, it will send an email with a link. The link has the following structure.
https://133.44.163.89:5000/user/56546dsfsd/forgetPassword/ddeef95c508
user-id token
What the backend developer wants from me is that when you click this URL a page should open on the frontend with a password reset form. But the link HOST is different how can I map this link HOST (https://133.44.163.89:5000) into the frontend HOST (http://localhost:3000) to open the page.
What should be the solution to this problem?