-2

I am trying to build a simple website with nodejs, express and vuejs. In tutorials i saw people recommending having the frontend and the backend communicate through an API by using the vue-cli. (example). 1. Do People use this method in production as well?

I also saw that you can build the vue cli files into a /dist folder and move this folder into the backend. Then you can use the backend to serve the generated index.html (example)

2. After doing this, is vue.js still communicating with the backend through the api i wrote with the vue cli for development? 3. Do i have to change code in the backend to deploy the website this way, other than statically serve the index.html file that was build by the vue-cli? and lastly 3.Can i just npm install vue and use the provided vue.min.js in a scripttag and just lose some usablillity while developing?

I hope my question is understandable and i appreciate every answer.

Mdtape
  • 1

1 Answers1

0

The backend typically serves the frontend via REST API.

Your Vue app is completely separate from your backend. Most applications keep business logic in the backend and use the frontend as a view. For smaller projects, you can keep the logic in the browser.

To answer your question directly: No, the Vue CLI is not used for that. It's purpose is to enhance your development process.

Relevant topics you should learn about: Representational state transfer (REST), Single page applications, Ajax

Advanced / less relevant topics: GraphQL, Server side rendering, HTTP, web sockets, MVC

Sam Bokai
  • 538
  • 1
  • 5
  • 13