currently i am learning web dev and i have a doubt.
My express is running on port 3000 and react is running on port 3001, and i want to handle the routing using express.
I made an authentication system using passportjs and now i only want to allow a user to go to “http://localhost:3001/” if he is logged in. But i am confused, how can i achieve it? Because if i add a middleware in express, it will be for port 3000.
I know it will be difficult to tell all this via text. So can you please suggest me some documentation or resources from which i can get to know about this.
Your help will be Grateful.
Thor is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.