こんばんは
gitのwebhookをNodeJSでやろうとしているのですが、gitページを更新してもWe couldn’t deliver this payload: Service Timeout
となってしまいます。
サーバはさくらのクラウドを使っており、CentOS6.7です。
これがサーバに記述したファイルで、Expressフレームワークのapp.jsと同じ階層においてあります。こちらのライブラリをほとんど丸写しです
//webhook.js var http = require('http') var createHandler = require('github-webhook-handler') var handler = createHandler({ path: '/webhook', secret: 'githubで登録したsecret文字列' }) http.createServer(function (req, res) { handler(req, res, function (err) { res.statusCode = 404 res.end('no such location') }) }).listen(7777) handler.on('error', function (err) { console.error('Error:', err.message) }) handler.on('push', function (event) { console.log('Received a push event for %s to %s', event.payload.repository.name, event.payload.ref) }) handler.on('issues', function (event) { console.log('Received an issue event for %s action=%s: #%d %s', event.payload.repository.name, event.payload.action, event.payload.issue.number, event.payload.issue.title) })
そして、github側では、payloadURLをドメインの7777番ポートに設定し、content typeはapplication/jsonに設定してあります。iptablesも7777番ポートを解放してあります。
どなたか他に心当たりがございませんでしょうか?
よろしくお願いいたします
あなたの回答
tips
プレビュー