【问题标题】:How to Deploy MEAN stack to my hosted server?如何将 MEAN 堆栈部署到我的托管服务器?
【发布时间】:2014-07-08 16:35:53
【问题描述】:

我有一个使用 MEAN 构建的出色工作网站,并且在本地运行良好。 我希望将它部署在我的服务器上, 但我从未部署过网站 除了将文件上传到我的网站 ftp。

教程有人吗?

【问题讨论】:

  • 如果您没有具有 root 访问权限的 Web 服务器,这将很困难。如果这样做,请登录您的服务器,安装 (M)ongoDB、(E)xpress.js、(A)ngular 和 (N)ode.js,将文件上传到服务器,导航到目标目录并执行。跨度>
  • 您需要具有 shell 访问权限的服务器或托管的 Node.js 服务,例如 Heroku。之后,它就像安装节点(如果您有 shell 访问权限)、安装依赖项并运行它一样简单。
  • 我自己也在尝试学习这个,找到了这个教程justinklemm.com/grunt-js-deployment-ssh-git

标签: node.js angularjs hosting mean-stack mean.io


【解决方案1】:

另一个不错的起点是 Digital Ocean,他们提供一键式安装 MEAN 堆栈和教程。 https://www.digitalocean.com/community/tutorials/how-to-use-the-mean-one-click-install-image

【讨论】:

    【解决方案2】:

    从这里开始... https://github.com/linnovate/mean#hosting-mean 您打算将其托管在什么操作系统上?

    【讨论】:

    • 过时的链接/答案
    【解决方案3】:

    我刚刚在Heroku cloud application 环境中部署了我的MEAN Stack application。部署步骤很简单。

    部署步骤:

    1. 您的平均堆栈项目结构应该类似于thisThis is very important step. The bottonline is your package.json and server.js should be under your root directory. Have a look at the link to know more about the structure.
    2. 在本地克隆您的远程存储库,即git clone https://github.com/heroku/node-js-getting-started.git
    3. 进入克隆的存储库,例如cd node-js-getting-started
    4. 运行git add .
    5. 运行git commit -m "Sample"
    6. 运行Heroku login(它会要求您按任意键然后打开浏览器并要求您单击登录。登录后关闭浏览器实例。
    7. 运行heroku create myApp --buildpack heroku/nodejsNote: Buildpacks are responsible for transforming deployed code into a slug, which can then be executed on a dynoMore information
    8. 运行git push heroku master。您的部署将开始。
    9. 部署完成后,您将在命令提示符终端上看到完整的部署日志
    10. 应用程序现已部署。确保至少有一个应用实例正在运行:heroku ps:scale web=1

    11. 运行heroku open。它将运行您部署的实例。

    12. 运行 heroku logs 以查看有关您正在运行的应用程序的信息。 More information

    您可以访问以下链接找到更多详细信息:

    https://devcenter.heroku.com/articles/getting-started-with-nodejs#prepare-the-app https://devcenter.heroku.com/articles/deploying-nodejs

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-12-21
      • 2017-09-05
      • 2017-08-24
      • 2017-09-05
      • 1970-01-01
      • 2018-11-08
      • 1970-01-01
      • 2023-03-24
      相关资源
      最近更新 更多