简体   繁体   中英

Deploy Node.js with Vue.js app to Hostinger

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.

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.

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM