{"action":"opened","issue":{"url":"https://api.github.com/repos/kasperlewau/koa-h2-man-pusher/issues/4","repository_url":"https://api.github.com/repos/kasperlewau/koa-h2-man-pusher","labels_url":"https://api.github.com/repos/kasperlewau/koa-h2-man-pusher/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/kasperlewau/koa-h2-man-pusher/issues/4/comments","events_url":"https://api.github.com/repos/kasperlewau/koa-h2-man-pusher/issues/4/events","html_url":"https://github.com/kasperlewau/koa-h2-man-pusher/issues/4","id":186758558,"number":4,"title":"Error in Readme and suggestions","user":{"login":"kristianmandrup","id":125005,"avatar_url":"https://avatars.githubusercontent.com/u/125005?v=3","gravatar_id":"","url":"https://api.github.com/users/kristianmandrup","html_url":"https://github.com/kristianmandrup","followers_url":"https://api.github.com/users/kristianmandrup/followers","following_url":"https://api.github.com/users/kristianmandrup/following{/other_user}","gists_url":"https://api.github.com/users/kristianmandrup/gists{/gist_id}","starred_url":"https://api.github.com/users/kristianmandrup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kristianmandrup/subscriptions","organizations_url":"https://api.github.com/users/kristianmandrup/orgs","repos_url":"https://api.github.com/users/kristianmandrup/repos","events_url":"https://api.github.com/users/kristianmandrup/events{/privacy}","received_events_url":"https://api.github.com/users/kristianmandrup/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-11-02T10:06:09Z","updated_at":"2016-11-02T10:06:09Z","closed_at":null,"body":"`koa.callback()` should be `app.callback()` since `const app = new Koa();`\r\n\r\n```js\r\nconst spdy = require('spdy');\r\nconst Koa = require('koa');\r\nconst manpush = require('koa-h2-man-pusher');\r\n\r\nconst app = new Koa();\r\n\r\napp.use(manpush.manifestor({ manifest: 'manifest.json' }));\r\napp.use(manpush.push());\r\n\r\nconst server = spdy.createServer({ key: 'path/to/ssl.key', cert: 'path/to/ssl.crt' }, app.callback());\r\n\r\nserver.listen(3000);\r\n```\r\n\r\nI suggest making a nice little wrapper for this common setup.\r\n\r\n```js\r\nconst manpusher = manpush.create(app).configure({ \r\n  manifest: 'manifest.json', \r\n  key: 'path/to/ssl.key', \r\n  cert: 'path/to/ssl.crt' \r\n})\r\n\r\napp\r\n  .use(manpusher.manifestor)\r\n  .use(manpusher.push)\r\n\r\n// or using koa-combine\r\napp\r\n  .use(combine(...manpusher.mw)) // returns all middleware in a list\r\n\r\nmanpusher.server.listen(3000)\r\n```\r\n\r\nCheers!"}}
{"actor":{"display_login":"kristianmandrup"}}