首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >不在根目录中的脚本的Heroku node.js Procfile

问不在根目录中的脚本的Heroku node.js Procfile
EN

Stack Overflow用户
提问于 2016-07-26 09:58:05
回答 1查看 253关注 0票数 0

我的目标是使用heroku和node.js https://github.com/whitec54/shouts-things创建一个groupme机器人

我对web开发非常陌生,所以这可能很明显,但我似乎不能修复我的heroku应用程序错误。

这是日志返回的消息:

代码语言:javascript
复制
2016-07-26T01:44:52.756548+00:00 heroku[web.1]: State changed from crashed to starting
2016-07-26T01:44:53.848661+00:00 heroku[web.1]: Starting process with command `node routes/index.js`
2016-07-26T01:44:55.966222+00:00 heroku[web.1]: Process exited with status 0
2016-07-26T01:45:09.474760+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=shouts-things.herokuapp.com request_id=19173085-e8ed-4a85-8cd9-90c96b7347f6 fwd="108.178.113.130" dyno= connect= service= status=503 bytes=
2016-07-26T01:45:08.701288+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=shouts-things.herokuapp.com request_id=f29fef93-7530-4c1e-9724-73884694b457 fwd="108.178.113.130" dyno= connect= service= status=503 bytes=

这个错误似乎比我开始时的错误更好,但我不确定从哪里开始。尽管我已经读过了,但我对Procfiles在heroku中的工作原理的理解是相当薄弱的。

EN

回答 1

Stack Overflow用户

发布于 2016-07-26 14:03:32

在您的Procfile中,它提到了启动routes/index.js,它没有任何代码来运行express服务器。您应该在app.js上注册此路由,并使用node启动app.js。

nodejs npm将帮助您开始使用express-generator项目所需的基本搭建。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/38579957

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档