Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
619 views
in Technique[技术] by (71.8m points)

node.js - Heroku Cannot GET /

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.

Cannot GET /

No errors when executing

git push heroku master

My Procfile is simply

web: node app.js

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

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

Then:

heroku open Opening APP-NAME... done

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...