{"action":"created","issue":{"url":"https://api.github.com/repos/probot/probot/issues/794","repository_url":"https://api.github.com/repos/probot/probot","labels_url":"https://api.github.com/repos/probot/probot/issues/794/labels{/name}","comments_url":"https://api.github.com/repos/probot/probot/issues/794/comments","events_url":"https://api.github.com/repos/probot/probot/issues/794/events","html_url":"https://github.com/probot/probot/issues/794","id":393337580,"node_id":"MDU6SXNzdWUzOTMzMzc1ODA=","number":794,"title":"Programatic start","user":{"login":"chadfawcett","id":3250463,"node_id":"MDQ6VXNlcjMyNTA0NjM=","avatar_url":"https://avatars2.githubusercontent.com/u/3250463?v=4","gravatar_id":"","url":"https://api.github.com/users/chadfawcett","html_url":"https://github.com/chadfawcett","followers_url":"https://api.github.com/users/chadfawcett/followers","following_url":"https://api.github.com/users/chadfawcett/following{/other_user}","gists_url":"https://api.github.com/users/chadfawcett/gists{/gist_id}","starred_url":"https://api.github.com/users/chadfawcett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chadfawcett/subscriptions","organizations_url":"https://api.github.com/users/chadfawcett/orgs","repos_url":"https://api.github.com/users/chadfawcett/repos","events_url":"https://api.github.com/users/chadfawcett/events{/privacy}","received_events_url":"https://api.github.com/users/chadfawcett/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-12-21T06:44:57Z","updated_at":"2018-12-22T18:11:56Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"## Feature Request\r\n\r\n**Is your feature request related to a problem? Please describe.**\r\nZeit Now 2.0 expects a function that accepts the standard Node.js `request` and `response` objects. In order to get this function, I need to use `createProbot`, load my Probot `appFn`, and expose `probot.webhook.middleware`.\r\n```js\r\n//  Simplified for clarity\r\nconst { createProbot } = require('probot')\r\nconst app = require('../')\r\n\r\nconst probot = createProbot({\r\n  id: process.env.APP_ID,\r\n  secret: process.env.WEBHOOK_SECRET,\r\n  cert: process.env.PRIVATE_KEY\r\n})\r\n\r\nprobot.load(app)\r\n\r\nmodule.exports = probot.webhook.middleware\r\n```\r\n\r\n**Describe the solution you'd like**\r\nThere seem to be a few use cases that could benefit from a programatic start (probot/friction#8, #780)\r\n\r\nThis code above is similar to what is suggested in both linked issues, and seems like a reasonable way to implement it. However, it would be nice to have some sort of function to take care of some of the configuration logic. [Discussing with @JasonEtco on slack](https://probot-talk.slack.com/archives/C6S4FC8AF/p1545370062021500?thread_ts=1545369534.018100&cid=C6S4FC8AF) he mentioned a programatic start like this would be something nice to have within Probot itself.\r\n\r\n**Describe alternatives you've considered**\r\nAnother approach, or perhaps complimentary to the above suggestion, would be to create a `serverless-now` package similar to [probot/serverless-lambda](https://github.com/probot/serverless-lambda#usage).\r\n\r\nThe simplest thing could be to just update the documentation for deploying to Zeit Now that explains how to deploy with the 2.0 API.\r\n\r\n**Teachability, Documentation, Adoption, Migration Strategy**\r\nNot sure I have much more to add here, other than I'd be happy to help out. I was planning to write a simple blog post about it, so I could morph that into a PR for the docs. I could create a `serverless-now` package (which I'll probably do on my own if it's not something Probot wants to manage. Lastly I could look into implementing the programatic start into Probot itself, but realistically I won't have the time to start on this for at least a week or two.\r\n"},"comment":{"url":"https://api.github.com/repos/probot/probot/issues/comments/449588587","html_url":"https://github.com/probot/probot/issues/794#issuecomment-449588587","issue_url":"https://api.github.com/repos/probot/probot/issues/794","id":449588587,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0OTU4ODU4Nw==","user":{"login":"passionkind","id":1783541,"node_id":"MDQ6VXNlcjE3ODM1NDE=","avatar_url":"https://avatars0.githubusercontent.com/u/1783541?v=4","gravatar_id":"","url":"https://api.github.com/users/passionkind","html_url":"https://github.com/passionkind","followers_url":"https://api.github.com/users/passionkind/followers","following_url":"https://api.github.com/users/passionkind/following{/other_user}","gists_url":"https://api.github.com/users/passionkind/gists{/gist_id}","starred_url":"https://api.github.com/users/passionkind/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/passionkind/subscriptions","organizations_url":"https://api.github.com/users/passionkind/orgs","repos_url":"https://api.github.com/users/passionkind/repos","events_url":"https://api.github.com/users/passionkind/events{/privacy}","received_events_url":"https://api.github.com/users/passionkind/received_events","type":"User","site_admin":false},"created_at":"2018-12-22T18:11:56Z","updated_at":"2018-12-22T18:11:56Z","author_association":"NONE","body":"left a note and link on my repo. Thanks @tibdex \r\nalready using your version 👍 "}}
{"actor":{"display_login":"passionkind"}}