0

I am a beginner at vue and node. I want to deploy a Vue.js app that uses an express api on different ports. The problem is that I do not know how to deploy the app so that the api works aswell. The api connects to a MySQL database that is hosted on Hostinger. I have already bought a Hostinger Business Web Hosting and am not sure how to continue. Until now, locally I used the package.json to start the "node api.js" and the "vue-cli-service serve" at the same time, but I am not sure how this could will work in production.

I have also seen some approaches with PM2, but they are not clear enough for me.

rolhai123
  • 59
  • 2
  • 6

3 Answers3

0

As I know it is impossible to host node.js app on hostinger Business Web Hosting. You better connect hostinger support. They have live chat and are always glad to help.

0

I asked question like that about how to install nodejs to shared hosting. You can try to install nodejs if success you can install vuejs too. Here Link of my question

officialmmt
  • 65
  • 1
  • 2
  • 12
0

I just talked to their customer support and as the others mentioned, you have to buy VPS for that :(

You can manually upload it (tutorial), but that is not ideal, to be honest. You can get a little cheeky and create a second repository, where you deploy your dist folder (which is automatically created when you run npm run build). Then you can automatically hook that repository with Hostinger. I have tried that out and it works :) You could think about automating the updates on the second repository with workflows, but I haven't done that so far.

As a side note: For quick deployment, Netlify allows makes it easy for simple applications. However, in your case, this option might not suit your situation as the backend might pose a problem to deploy.

Leo Giesen
  • 126
  • 5