简体   繁体   English

如何在Heroku上部署Node.js

[英]how to deploy nodejs on heroku

Hi I developed a small application in nodeJs and angular using the angular-fullstack generator for grunt, following the instruction on: https://npmjs.org/package/generator-angular-fullstack , when I finished the developement run: 嗨,我完成了开发运行后,按照https://npmjs.org/package/generator-angular-fullstack上的说明,使用angular-fullstack生成器为nodeJs和angular开发了一个小型应用程序:

 3) yo angular-fullstack:deploy heroku 4) cd heroku && git push heroku master 

my application now is on heroku and the dynos starts, but when I visit the domain where heroku put my application: http://dollsdresses-gnosis.herokuapp.com/ I can see that some files are missing: main.css, script.js , all I can see is a white page with my favicon, when I use my application on my computer, running: grunt server, it works, so I think there is something that I do not know or do wrong on deploying on heroku. 我的应用程序现在在heroku上,并且dynos启动,但是当我访问heroku放置我的应用程序的域时: http : //dollsdresses-gnosis.herokuapp.com/我可以看到缺少一些文件:main.css,脚本。 js,当我在计算机上使用运行以下应用程序的应用程序时,我看到的只是一个带有我的图标的白页:grunt服务器,它可以工作,所以我认为在heroku上部署时我不知道或做错了什么。

You may not have added main.css , script.js et al to git, so they are not pushed to Heroku when you run git push heroku master . 您可能尚未在git中添加main.cssscript.js等,因此当您运行git push heroku master时,它们不会被推送至Heroku。 Make sure to git add them. 确保git add它们。

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

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