如何部署一个应用Angular.js? [英] How do I deploy an Angular.js app?

查看:225
本文介绍了如何部署一个应用Angular.js?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这可能是一个愚蠢的问题,但我不知道我应该用什么平台来部署我Angular.js应用程序?我试着使用Heroku的,但有一个无雪松支持的应用程序检测的错误。有什么想法?

This may be a stupid question, but I'm wondering what platform I should use to deploy my Angular.js app? I tried using Heroku but got a "no Cedar-supported app detected" error. Any thoughts?

更新

我想成为这heorku作为Node.js的应用程序,但似乎仍不能得到它的工作。有一个在我的应用程序的根目录下的web-server.js文件,我引用它在我这里Procfile:

I'm trying to serve this to heorku as a Node.js application, but still can't seem to get it working. There's a web-server.js file in the root directory of my application and I reference it in my Procfile here:

web: node web-server.js

和这里是我的package.json文件,同样在根目录下:

And here's my package.json file, also in the root directory:

{
"name": "medicare-data",
"version": "0.0.1",
"dependencies": {
},
"engines": {
    "node": "0.10.x",
    "npm": "1.2.x"
},
"respository": "medicare-data",
"author": "sararob"
}

我在我的Heroku的日志得到一个塞编译错误。为什么这个想法可能无法正常工作?

I'm getting a "slug compilation error" in my heroku logs. Thoughts on why this might not be working?

推荐答案

您可以如果它担任的Node.js应用程序运行在Heroku上的角应用。通常情况下,当你开始用角种子工作,已经有在项目中的一个节点的Web服务器脚本。我相信,如果有一个在根文件的package.json,Heroku的将检测并运行它作为一个Node.js应用程式。我会回来,并更新这个答案很快用更详细。

You can run an Angular app on heroku if it is served as a node.js application. Usually, when you start working with Angular seed, there is already a node webserver script in the project. I believe if there is a package.json file in the root, heroku will detect and run it as a node.js application. I'll come back and update this answer with more detail shortly.

更新

(我不是专家)从Heroku的文档,它部署后段这样一段话:<一href=\"https://devcenter.heroku.com/articles/nodejs#visit-your-application\">https://devcenter.heroku.com/articles/nodejs#visit-your-application

From the Heroku docs (and I am no expert), it has this passage after the deploy section: https://devcenter.heroku.com/articles/nodejs#visit-your-application

基本上告诉你,以确保你有一个测功机的运行。你可以这样做既可以通过在你的应用程序的设置Web应用程序,也可以运行这样的:

which basically tells you to make sure you have one dyno running. You can do that either through the web app under the settings of your app or you can run this:

$ heroku ps:scale web=1

要查看是否正在运行的进程,执行

To see if the process is running, do

$ heroku ps
=== web: `node web.js`
web.1: up for 10s

这篇关于如何部署一个应用Angular.js?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆