I want to know the best practices involved in integrating nodejs and vuejs applications.
I looking at various options and I’m not sure which is the best
CodePudding user response:
The best approach is to have a nodejs API in one place and a VueJS app in another and to communicate between both via API calls.
Not sure which other ones there are.
CodePudding user response:
└───your-folder
├───api // Your Nodejs server
└───client // Your Vue app
Create a folder like this. Now start your Node API on any port (for example 3000) and then start your Vue app on different port (for example 4000).
Now you can send any request (GET, POST, PUT etc.) from your Vue app to your Node API. In our case API origin is http://localhost:3000