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
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
2
Answers
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.
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