0

我在 heroku 部署了简单的 hubot 应用程序。当我使用检查日志时,我已经设置了 procfile 并使其正常运行heroku logs -t

咖啡脚本:

module.exports =(机器人)->

   robot.hear /room/i, (res) ->
    res.send "welcome " + res.message.room

过程文件:

web: bin/hubot -a campfire --name rsc

日志:

2016-12-17T11:20:53.198149+00:00 heroku[web.1]: Restarting
2016-12-17T11:20:53.198657+00:00 heroku[web.1]: State changed from up to startin
g
2016-12-17T11:20:53.978046+00:00 heroku[web.1]: Stopping all processes with SIGT
ERM
2016-12-17T11:20:54.099831+00:00 heroku[web.1]: Process exited with status 0
2016-12-17T11:20:54.832775+00:00 heroku[web.1]: Starting process with command `b
in/hubot -a campfire --name rsc`
2016-12-17T11:21:00.807546+00:00 heroku[web.1]: State changed from starting to u
p
2016-12-17T11:21:00.535290+00:00 app[web.1]: [Sat Dec 17 2016 11:21:00 GMT+0000
(UTC)] ERROR hubot-heroku-alive included, but missing HUBOT_HEROKU_KEEPALIVE_URL
. `heroku config:set HUBOT_HEROKU_KEEPALIVE_URL=$(heroku apps:info -s  | grep we
b-url | cut -d= -f2)`
2016-12-17T11:21:00.675448+00:00 app[web.1]: [Sat Dec 17 2016 11:21:00 GMT+0000
(UTC)] INFO hubot-redis-brain: Discovered redis from REDISCLOUD_URL environment
variable
2016-12-17T11:21:00.768728+00:00 app[web.1]: [Sat Dec 17 2016 11:21:00 GMT+0000
(UTC)] INFO hubot-redis-brain: Successfully authenticated to Redis
2016-12-17T11:21:00.784649+00:00 app[web.1]: [Sat Dec 17 2016 11:21:00 GMT+0000
(UTC)] INFO hubot-redis-brain: Data for hubot brain retrieved from Redis

现在我从哪里ping到hubot?从营火网站?我做了,但它没有响应

4

1 回答 1

0

我相信您在路线中需要两个参数,而您只有一个(res):

   robot.hear /room/i, (req, res) ->
     res.send "welcome " + res.message.room
于 2016-12-17T11:41:09.570 回答