Heroku 无法获取/ [英] Heroku Cannot GET /

查看:13
本文介绍了Heroku 无法获取/的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 Heroku 的新手,相信我正在按照 Heroku 网站上列出的所有步骤通过 node.js 进行部署 – https://devcenter.heroku.com/articles/getting-started-with-nodejs – 但尽管有成功的迹象,但我只在浏览器中看到这个我新生成的 herokuapp.com 网站.

I am new to Heroku and believe I am following all of the steps outlined on Heroku's website to deploy via node.js – https://devcenter.heroku.com/articles/getting-started-with-nodejs – but despite indications of success, I only see this in the browser when I go to my newly-generated herokuapp.com site.

无法获取/

执行时没有错误

git push heroku master

我的 Procfile 很简单

My Procfile is simply

web: node app.js

我还不太了解 dynos,但似乎有一个正在运行:

I dont quite understand dynos yet, but there seems to be one running:

heroku ps=== web (1X): node app.jsweb.1: up 2014/07/03 23:55:00 (~ 18m 前)

heroku ps === web (1X): node app.js web.1: up 2014/07/03 23:55:00 (~ 18m ago)

那么:

heroku 打开正在打开 APP-NAME...完成

heroku open Opening APP-NAME... done

但是 https://APP-NAME.herokuapp.com/ 只显示 无法获取/ 消息.

But https://APP-NAME.herokuapp.com/ just displays the Cannot GET / message.

推荐答案

我的 dist 目录包含在我的 .gitignore 文件中,所以我没有将 dist 提交到我的回购而不是将其推送到 Heroku.因此,Heroku 找不到任何要提供的内容.

I had my dist directory included in my .gitignore file so I was not committing dist to my repo and not pushing it to Heroku. Therefore, Heroku could not find any content to serve.

我更新了我的 .gitignore、提交和推送,我的应用现在在 Heroku 上显示得很好.

I updated my .gitignore, committed, and pushed, and my app shows up just fine on Heroku now.

这篇关于Heroku 无法获取/的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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