search

Home  >  Q&A  >  body text

node.js - How to deploy vue server-side rendering online

Taking the official hackernews example as an example, the packaged file does not have an html file, so how to deploy it on the server

I feel that servicew-worker.js is the key. The official example supports pwa, which makes it a bit complicated. The company uses PHP for the backend and Vue for the frontend. Does anyone know how to solve this problem? I have been working on this problem on Saturday and Sunday. I am confused and have not found a solution. I have not found any results on Google and Github.

巴扎黑巴扎黑2763 days ago736

reply all(2)I'll reply

  • 習慣沉默

    習慣沉默2017-06-05 11:12:55

    You need to run nodejs on the server side. You need to use a renderer provided by vue to generate an html string from the serverbundle. This renderer is written in js. If you want to run it on the server side, you need nodejs

    reply
    0
  • 为情所困

    为情所困2017-06-05 11:12:55

    Problem solved, I realized I was too stupid. In fact, I run my own project locally, using node as the server and mongodb as the database. I just need to start two services at the same time, namely server.js and app.js running on the server

    reply
    0
  • Cancelreply