简体   繁体   English

如何在godaddy VPS上部署MERN应用程序

[英]How do I deploy a MERN application on a godaddy VPS

The only experience I have with deploying something is via git onto Heroku. 我部署一些东西的唯一经验是通过git到Heroku。 How do I deploy an entire website onto a go daddy VPS? 如何将整个网站部署到go daddy VPS上?

I downloaded puTTY(SSH) and was able to connect to the server, from there I installed nvm and it's now allowing me to use node and NPM. 我下载了puTTY(SSH)并且能够连接到服务器,从那里我安装了nvm,它现在允许我使用节点和NPM。 If I use the ls command from the bash terminal it doesn't show any files. 如果我使用bash终端的ls命令,它不会显示任何文件。 How do I actually upload my project onto the server and have them displayed on the website? 如何将我的项目实际上传到服务器并将其显示在网站上?

doing it with git and Heroku was easy I just created a Heroku link, logged in and pushed my application with GIT. 使用git和Heroku很简单我只是创建了一个Heroku链接,登录并用GIT推送我的应用程序。

I'd like to deploy a basic MERN website to a GoDaddy VPS and have it displayed on the intended domain. 我想将一个基本的MERN网站部署到GoDaddy VPS并将其显示在预期的域上。

Steps 脚步

  1. got to react app folder and do npm install && npm run build 得到应用程序文件夹并执行npm install && npm run build
  2. start the node server 启动节点服务器
  3. server react app build folder from your express routes 服务器响应快速路由中的应用程序构建文件夹

optionally you can use serve or PM2 to serve the build on separate port, but this will require you to run your MERN application on 2 ports 您可以选择使用servePM2在单独的端口上提供构建服务,但这需要您在2个端口上运行MERN应用程序

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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