如何ping在heroku

时间:2016-12-17 11:36:29

标签: javascript node.js heroku hubot campfire

我在heroku部署了简单的hubot应用程序。当我使用heroku logs -t

检查日志时,我已设置procfile及其正常运行

咖啡脚本:

module.exports =(机器人) - >

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

procfile:

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?来自篝火网站?我做了但没有回复

1 个答案:

答案 0 :(得分:0)

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

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